madskristensen / WebEssentials2013

Visual Studio extension
http://vswebessentials.com
Other
944 stars 251 forks source link

Minify AngularJs modules causes exception #1904

Open janmohammadi opened 9 years ago

janmohammadi commented 9 years ago

Web Essentials javascript minification changes AngularJs modules arguments names, and this causes exception for AngularJs Dependency injector. example: changes this: myapp.config(function ($routeProvider) { $routeProvider.when('/', { //..... }); to this: myapp.config(function(n){n.when("/",{})

renamed $routeProvider to n .

janmohammadi commented 9 years ago

according to this page https://docs.angularjs.org/tutorial/step_05

i changed my code style from this: function PhoneListCtrl($scope, $http) {...} to this: phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function($scope, $http) {...}]);