javascript - AngularJS Error: Unknown provider: aProvider <- a -
ok i'm officially bald now, after having been streching hair out infamous problem: minfied angularjs app doesn't work, error thown out:
error: [$injector:unpr] unknown provider: aprovider <- http://errors.angularjs.org/1.2.6/$injector/unpr?p0=aprovider%20%3c-%20a @ http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11492 @ http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26946 @ object.c [as get] (http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250) @ http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:27041 @ c (http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26250) @ object.d [as invoke] (http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:26496) @ http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:910 @ object.f [as foreach] (http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:4:11927) @ http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:9:856 @ j (http://localhost/my-app/dist/scripts/1bde0e2e.vendor.js:5:27235)
lots of other people had problem well, looks fixed declaring dependencies array instead of bare function parameters, this:
angular.module('my-app').controller('loginctrl', [ '$scope', 'httpservice', function($scope, httpservice) { ... }]); instead of this:
angular.module('my-app').controller('loginctrl', function($scope, httpservice) { ... }); but doesn't work in case. checked of scripts (coffee , generated javascripts well), use proper array-style declaration.
the problem doesn't come packages apparently. tried moving package references out of <!-- bower:js --> block (so not minified grunt), yet problem still remains. means, it's code blame... again, i've tried (seems be) fix available, no avail.
any hint, on how debug this?
thanks in advance!
finally i've found problem. , yes, it's di bug missed.
to may suffering same headache: array-format declaration must done in $routeprovider's resolve options well. in case (coffeescript ahead):
app.config (['$routeprovider', ($routeprovider) -> $routeprovider .when '/', templateurl: 'views/main.html' controller: 'mainctrl' resolve: groups: ['groupservice', (groupservice) -> # missed return groupservice.getall() ] entries: ['entryservice', (entryservice) -> # , return entryservice.getall() ] # ... ]) hope helps!
Comments
Post a Comment