Skip to content

Template header & template footer added to options#56

Closed
uetkaje wants to merge 2 commits intomiickel:masterfrom
uetkaje:master
Closed

Template header & template footer added to options#56
uetkaje wants to merge 2 commits intomiickel:masterfrom
uetkaje:master

Conversation

@uetkaje
Copy link
Copy Markdown

@uetkaje uetkaje commented Dec 1, 2014

I use gulp-angular-templatecache with gulp-ng-autobootstrap & webpack.

It would be nice, if templates can be changeable according to the developer's needs.

As you can see below, i need to change templates to

var s = gulp.src('./templates/**/*.html')
    .pipe(ngTemplateCache({
        moduleSystem: 'browserify',
        templateHeader: '["$templateCache", function ($templateCache) {\n',
        templateFooter: '\n}];'
    }))
    .pipe(gulp.dest('./public'));

Output:

module.exports = ["$templateCache", function ($templateCache) {
    $templateCache.put("template1.html","<p>template 1</p>");
    $templateCache.put("template2.html","<p>template 2</p>");
    $templateCache.put("template3.html","<p>template 3</p>");
}];

@moderndegree
Copy link
Copy Markdown

+1
However, you might want to fix the tests. I believe the tab ('\t') you added is causing the existing assertions to fail. You might also want to add some new tests for the header/footer options.

@uetkaje
Copy link
Copy Markdown
Author

uetkaje commented Dec 8, 2014

You're right. I fixed the tests.

@mtr
Copy link
Copy Markdown

mtr commented Dec 8, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants