If you want to use abbreviations, add the gulp-ng-annotate plug-in to the gulp process. var ngAnnotate = require('gulp-ng-annotate');
gulp.task('useref-ftl', function () {
return gulp.src(*******)
.pipe(gulpif('*.js', ngAnnotate()))
});
The following is the principle: Dependencies are found by strings. When writing, take the initiative to write the dependencies without abbreviating them. For example, the formal writing method is angular.module('adminApp').controller('TestCtrl', ['$scope',function($scope) {}]) Then generally you can abbreviate it to angular.module(' adminApp').controller('TestCtrl', [function($scope) {}]) But the abbreviated method will report an error after compression and merging.
Dependencies are found based on strings. When writing, you take the initiative to write the dependencies, because variables and other things will change after compression, and Angular cannot find it by itself.
If you want to use abbreviations, add the gulp-ng-annotate plug-in to the gulp process.
var ngAnnotate = require('gulp-ng-annotate');
The following is the principle:
Dependencies are found by strings. When writing, take the initiative to write the dependencies without abbreviating them.
For example, the formal writing method is
angular.module('adminApp').controller('TestCtrl', ['$scope',function($scope) {}])
Then generally you can abbreviate it to
angular.module(' adminApp').controller('TestCtrl', [function($scope) {}])
But the abbreviated method will report an error after compression and merging.
Has the reference path changed after compression
Dependencies are found based on strings. When writing, you take the initiative to write the dependencies, because variables and other things will change after compression, and Angular cannot find it by itself.