Неверный URL шаблона для templateCache в Angularjs, использующем gulp

введите описание изображения здесь URL шаблона, загруженный после сборки Gulp, неверен. я ожидаю, что URL шаблона должен быть $templateCache.put('scripts/app/cinemasList/cinemasList.html'), но фактическим является $ templateCache.put ('scripts / cinemasList / cinemasList.html')

gulp.task('ngtemplate', function() {
 return gulp.src(config.srcTemplates)

.pipe($.minifyHtml({
  empty: true,
  spare: true,
  quotes: true
}))
.pipe($.ngHtml2js({
  template: "    $templateCache.put('<%= template.url %>',\n        '<%= template.prettyEscapedContent %>');",
  prefix: 'scripts/'
}))
.pipe($.concat('templates.js'))
.pipe($.tap(function(file, t) {
  file.contents = Buffer.concat([
    new Buffer("(function(module) {\n" +
      "try {\n" +
      "  module = angular.module('myApp');\n" +
      "} catch (e) {\n" +
     // "  module = angular.module('myApp', []);\n" +
      "}\n" +
      "module.run(['$templateCache', function($templateCache) {\n"),
    file.contents,
    new Buffer("\n}]);\n" +
      "})();\n")
  ]);
}))


.pipe(gulp.dest(config.scripts + 'templates'));

});

0 ответов

Другие вопросы по тегам