“Unknown provider: aProvider <- a” How do I find the original provider?

后端 未结 9 666
自闭症患者
自闭症患者 2020-12-07 08:46

When I\'m loading the minified (through UglifyJS) version of my AngularJS application, I get the following error in the console:

Unknown provider: aProvider          


        
9条回答
  •  天命终不由人
    2020-12-07 09:44

    Also do not forget the resolve property of the route. It also must be defined as the array:

    $routeProvider.when('/foo', {
        resolve: {
            bar: ['myService1', function(myService1) {
                return myService1.getThis();
            }],
            baz: ['myService2', function(myService2) {
                return myService2.getThat();
            }]
        }
    });
    

提交回复
热议问题