我正在使用gulp-angular-templacache
. 我有那个任务应该创建一个名为的模块templates
,并将它作为依赖项添加到我的app
模块中:
配置:
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));
});
但是,当我尝试运行它时,我总是收到该错误消息:
未捕获的错误:[$injector:nomod] 模块“模板”不可用!您要么拼错了模块名称,要么忘记加载它。如果注册模块,请确保将依赖项指定为第二个参数。
我试图使模板缓存也不是独立的并删除依赖项但没有成功......我该怎么办?