Angular annotation

It looks like I need to perform .pipe(ngAnnotate()) during the “scripts” to avoid an Angular “Unknown provider: tProvider ← t” error.

Do you know how I would add this to the sage gulpfile.js? Would it be within the merged.add()?

Thx again!

Add it like

var jsTasks = function(filename) {
  return lazypipe()
    .pipe(function() {
      return $.if(enabled.maps, $.sourcemaps.init());
    .pipe($.concat, filename)
    .pipe(function() {
      return $.if(enabled.rev, $.rev());
    .pipe(function() {
      return $.if(enabled.maps, $.sourcemaps.write('.'));

Check out Disable uglify in Gulpfile

1 Like

Just FYI everyone the above suggestion and the steps below worked for me on a recent project:

  1. Run npm install gulp-ng-annotate --save-dev
  2. Add var ngAnnotate = require('gulp-ng-annotate'); at the top of the gulpfile
  3. Do the above that @austin recommended, just with pipe(ngAnnotate) instead because we don’t use the $. syntax anymore
  4. Write some cool shit in angular