Angularjs minify best practice

前端 未结 7 1507
孤独总比滥情好
孤独总比滥情好 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 04:02

    Just to point out that if you use

    Yeoman

    there is no need to do like

    var MyController = ['$scope', '$http', function($scope, $http) {
      $http.get('https://api.github.com/repos/angular/angular.js/commits')
        .then(function(response) {
          $scope.commits = response.data
        })
    }]
    

    because grunt during minify take into account how to manage DI.

    0 讨论(0)
提交回复
热议问题