0

gulp-angular-templatecache我在我的应用程序中正常工作时遇到了严重的问题。我正在使用 HotTowel yeomen 生成器并对其进行了一些修改,但我似乎无法让我的模板缓存使用不同的模块名称。这是相关的 gulpfile 代码:

gulp.task('templatecache', ['clean-code'], function() {
    log('Creating an AngularJS $templateCache');

    return gulp
        .src(config.htmltemplates)
        .pipe($.if(args.verbose, $.bytediff.start()))
        .pipe($.minifyHtml({empty: true}))
        .pipe($.if(args.verbose, $.bytediff.stop(bytediffFormatter)))
        .pipe($.angularTemplatecache(
            'templates.js',
            {
                module: 'app.templates',
                standalone: true,
                root: 'app/',
                moduleSystem: 'IIFE'
            }
        ))
        .pipe(gulp.dest(config.temp));
});

原来的 HotTowel gulpfile 有{module: 'app.core', standalone: false, root: 'app/'}作为选项。每次我运行构建过程时,我愚蠢的 templates.js 文件看起来像这样: angular.module("app.core").run(["$templateCache"....

我已经尝试了很多事情来改变它,但它永远不会去app.templates。有任何想法吗?

4

0 回答 0