Не могу минифицировать файлы Angular с помощью gulp
var gulp = require('gulp')
var concat = require('gulp-concat')
var sourcemaps = require('gulp-sourcemaps')
var uglify = require('gulp-uglify')
var ngAnnotate = require('gulp-ng-annotate')
gulp.task('js', function() {
var source = ['components/itunseApp.js', 'components/factory.js', 'components/config.js', 'components/directive.js', 'components/viewCtrl.js'];
return gulp.src(source)
.pipe(sourcemaps.init())
.pipe(concat('all.min.js', { newLine: ';' }))
.pipe(ngAnnotate({
add: true
}))
.pipe(uglify({ mangle: true }))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('components'));
});
gulp.task('watch', ['js'], function() {
gulp.watch('components/*.js', ['js'])
})
Контроллер на котором выдает ошибку
itunseApp.controller('viewCtrl', ['$scope', '$location', '$routeParams', 'itunesSearch', function($scope, $location, $routeParams, itunesSearch) {
console.log('viewCtrl');
$scope.categoryParam = window.localStorage.getItem('categoryParam') || '';
$scope.searchParam = window.localStorage.getItem("searchParam") || '';
switch ($scope.categoryParam) {
case "song":
$scope.entity = 'song';
$scope.idParam = $routeParams.collectionId || window.localStorage.getItem('idParam');
break;
case "music-video":
$scope.entity = 'musicVideo';
$scope.idParam = $routeParams.trackId || window.localStorage.getItem('idParam');
break;
case "software":
$scope.entity = 'software';
$scope.idParam = $routeParams.trackId || window.localStorage.getItem('idParam');
break;
case "feature-movie":
$scope.entity = 'movie';
$scope.idParam = $routeParams.trackId || window.localStorage.getItem('idParam');
break;
}
itunesSearch.getInfo("http://itunes.apple.com/lookup", $scope.searchParam, $scope.entity, $scope.arrayParams, $scope.idParam).then(data => {
$scope.arrayParams = data.array;
});
window.localStorage['idParam'] = $scope.idParam;
}]);
Конкретно эти две строчки ему не нравятся
itunesSearch.getInfo("http://itunes.apple.com/lookup", $scope.searchParam, $scope.entity, $scope.arrayParams, $scope.idParam).then(data => {
$scope.arrayParams = data.array;
});
Это отдельно написаная фабрика
скрин с ошибкой