Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const viewFiles = ['src/js/**/*.html', '!src/js/**/*.async.html'];
const asyncViewFiles = 'src/js/**/*.async.html';
gulp.task('asyncViews', function () {
return gulp.src(asyncViewFiles)
.pipe(gulp.dest('./build/templates'));
});
gulp.task('views', ['asyncViews'], function () {
return gulp.src(viewFiles)
.pipe(templateCache({
standalone: true,
}))
.on('error', interceptErrors)
.pipe(rename('app.templates.js'))
.pipe(gulp.dest('./src/js/config/'));
});
// inside my angular component
// if i want to load the view asynchronously
templateUrl: 'templates/providerTerms/providerTerms.async.html',
// otherwise
templateUrl: 'providerTerms/providerTerms.html',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.