Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformUrl not working? #90

Closed
ehorodyski opened this issue Jul 9, 2015 · 4 comments
Closed

transformUrl not working? #90

ehorodyski opened this issue Jul 9, 2015 · 4 comments

Comments

@ehorodyski
Copy link

Sorry to post such a simple question, but I want to make sure I'm writing my statement correctly. What I'm trying to do is append a timestamp to each .html file being put into the template cache, to try to cachebust it on the fly since our templateCache task is being watched for changes and recompiles as we edit HTML files.

This is how I'm approaching the statement (I'm using gulp-util so that's why the module name looks funny:

.pipe($.angularTemplatecache('templates.js', { transformUrl: function (url) { return url + '?' + date.toJSON(); } }))

Along with the full task:

gulp.task('template', function() {

    var date = new Date();
    return gulp.src(config.dir.ngDev + '**/*.html')
        .pipe($.plumber({ errorHandler: onError }))
        .pipe($.angularTemplatecache('templates.js', { transformUrl: function (url) { return url + '?' + date.toJSON(); } }))
        .pipe(gulp.dest(dest.ngCompiled));

});
@vigie
Copy link

vigie commented Aug 21, 2015

Was having the same issue, but updating my version (from 1.5 to 1.7) solved this for me. Looks like transformUrl was not introduced until April this year.

Try updating.

@miickel
Copy link
Owner

miickel commented Aug 26, 2015

@ehorodyski did updating solve your problems with transformUrl?

@elgervb
Copy link

elgervb commented Sep 14, 2015

Got the same issue, but it was resolved when updating ;-)

@miickel
Copy link
Owner

miickel commented Oct 10, 2015

cool, I'll close this now. thanks all

@miickel miickel closed this as completed Oct 10, 2015
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

No branches or pull requests

4 participants