
Company News
Socket Joins the OpenJS Foundation
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.
fly-ng-templatecache
Advanced tools
Concatenate and register Angular JS templates in the $templateCache, with [Fly][fly].
npm install --save-dev fly-ng-templatecache
exports.default = function * () {
yield this.source('templates/**/*.html')
.ngTemplates({
file: 'views.js',
standalone: true,
moduleName: 'app.templates'
})
.target('dist/js');
}
Type: string
Default: templates.js
The name of the file that will be place in your target() destination. Do not include a directory structure here.
Type: string
Default: 'templates'
The name of your Angular JS module or submodule.
Type: string
Default: null
Options: 'iffe', 'requirejs', 'browserify', 'es6'
The module system for which your module should be prepared.
Type: boolean
Default: false
If true, creates a new Angular JS module. If false, it is assumed that you are using an existing module.
Type: string
Default: angular.module("<%= module %>"<%= standalone %>).run(["$templateCache", function($templateCache) {
This precedes your template content and will correctly initialize your Angular module. It is not recommended you change this, but if you do, you must retain the <%= module %> variable.
If the standalone option is true, an empty dependency array ([]) will replace <%= standalone %>.
Type: string
Default: $templateCache.put("<%= url %>","<%= contents %>");
The template wrapper for each view's content. It is not recommended to change this.
Type: string
Default: }]);
This is appended to your module file. There probably is no reason to change this.
Type: function or string
Default: ''
A function that handles or alters your views' reference URLs. If using string, the value will simply be removed.
.ngTemplates({
trim: str => str.replace('app/views', 'views');
})
//=> ng-include="views/demo.html"
//=> INSTEAD OF
//=> ng-include="app/views/demo.html"
MIT © Luke Edwards
FAQs
Concatenate and register Angular JS templates in the $templateCache.
We found that fly-ng-templatecache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.

Security News
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.