Created
October 17, 2016 20:33
-
-
Save m0n01d/43a4682f7bbbeb232f17b266056f940b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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