我正在使用gulp-angular-templacache
。 我应该创建一个模块名为templates
这个任务,我增加一条,作为一个依赖于我的app
模块:gulp-angular-templatecache模块不可用
配置:
templateCache: {
file: 'tempaltes.js',
options: {
module: 'templates',
standalone: true,
root: 'app/'
}
}
应用模块:
var App = angular.module('app', [
'templates']);
咕嘟咕嘟任务:
gulp.task('templatecache', ['clean-code'], function() {
log('Creating AngularJS $templateCache');
return gulp
.src(config.htmltemplates)
.pipe($.minifyHtml({empty: true}))
.pipe($.angularTemplatecache(
config.templateCache.file,
config.templateCache.options
))
.pipe(gulp.dest(config.temp));
});
但是,当我尝试运行此我总是收到这个错误消息:
Uncaught Error: [$injector:nomod] Module 'templates' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
我试图让templatescache也不是独立的和删除的依赖,但没有成功...... 我应该怎么做?
什么是文件的顺序? – Satpal
'file:'tempaltes.js'' –
我在询问脚本标记的序列 – Satpal