Rails 3 + angularjs + minification does not work in production: Unknown provider: eProvider

前端 未结 3 758
别那么骄傲
别那么骄傲 2021-02-02 11:30

I\'ve followed all the instructions I can find for fixing minification, e.g.

var MyController = function(renamed$scope, renamedGreeter) {
...
}
MyController.$inj         


        
3条回答
  •  无人共我
    2021-02-02 11:50

    Remember, to also use DI on controllers within directives. Took me hours... CS example:

    wrong:

    controller: ($scope) ->
      $scope.closeModal = ->
        ModalService.close()
    

    right:

    controller: ["$scope"
      ($scope) ->
        $scope.closeModal = ->
          ModalService.close()
    ]
    

提交回复
热议问题