我正在使用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