Failed to instantiate module [$injector:unpr] Unknown provider: $routeProvider

后端 未结 3 550
囚心锁ツ
囚心锁ツ 2020-11-28 20:26

I received this error upon upgrading from AngularJS 1.0.7 to 1.2.0rc1.

3条回答
  •  庸人自扰
    2020-11-28 21:10

    In my case it was because the file was minified with wrong scope. Use Array!

    app.controller('StoreController', ['$http', function($http) {
        ...
    }]);
    

    Coffee syntax:

    app.controller 'StoreController', Array '$http', ($http) ->
      ...
    

提交回复
热议问题