Angularjs minify best practice

前端 未结 7 1597
孤独总比滥情好
孤独总比滥情好 2020-11-22 03:12

I\'m reading http://www.alexrothenberg.com/2013/02/11/the-magic-behind-angularjs-dependency-injection.html and it turned out that angularjs dependency injection has problem

7条回答
  •  耶瑟儿~
    2020-11-22 03:56

    Yes, always! So this way even if your minifer converts $scope to variable a and $http to variable b, their identity is still preserved in the strings.

    See this page of AngularJS docs, scroll down to A Note on Minification.

    UPDATE

    Alternatively, you can use ng-annotate npm package in your build process to avoid this verbosity.

提交回复
热议问题