When I define angular like following, it will cause issue on using minification this javascript, which is Error: $injector:modulerr Module Error.
angular.module('myModule').controller('MyController', function ($scope) {
});
Now, if I write my angular as following, it'll be fine after minification.
angular.module('myModule').controller('MyController', ["$scope", function ($scope) {
}]);
During the minification, the first way will convert the $scope to other variable name, looks like that the issue. Is there a way I can avoid not writing code as the second case?