I've three html partials in my application and i'm creating an angular module using gulp template cache.
Html file names:
- dropdown.html
- dropdown-select.html
- dropdown-multiselect.html
Gulp Task:
gulp.task('dropdown', function( )
{
return gulp.src('modules/dropdown/*.html')
.pipe(plugins.plumber())
.pipe(plugins.templatecache({
output: 'dropdown_template.js',
moduleName: 'dropdown',
prepend: 'dropdown.html', // Need to replace with actual file name's
strip: 'views/'
}))
.pipe(gulp.dest('build/js/templates'));
});
After executing the above gulp task. It generates below angular module
angular.module("dropdown").run(['$templateCache', function(a) { a.put('dropdown.html', '<div class="dropdown" ng-transclude="parent"></div>\n' +
''); // 1st html
a.put('dropdown.html', '<div ng-transclude="1"></div>\n' +
''); //2nd html - name is wrong it should be dropdown-select.html
a.put('dropdown.html', '<div class="dropdown-menu dropdown-menu--{{ position }}">\n' +
'');// 3rd html - name is wrong it should be dropdown-multiselect.html
}]);
a.put('dropdown.html') is being generated for all 3 html's. But i need the actual file name instead of dropdown.html. Like below
angular.module("dropdown").run(['$templateCache', function(a) { a.put('dropdown.html', '<div class="dropdown" ng-transclude="parent"></div>\n' +
'');
a.put('dropdown-select.html', '<div ng-transclude="1"></div>\n' +
'');
a.put('dropdown-multiselect.html', '<div class="dropdown-menu dropdown-menu--{{ position }}">\n' +
'');
}]);
Please let me know how to do it.