Angular JS console errors: line numbers do not apply to my source files

I am making my first Angular application, and I am trying to figure out how to use the errors displayed in the console to find out where something is breaking in my code. Here is an example console error:

Error: [$injector:unpr] Unknown provider: HomeProvider <- Home http://errors.angularjs.org/1.2.5/$injector/unpr?p0=HomeProvider%20%3C-%20Home at http://recipe-app/lib/angular/angular.js:78:12 at http://recipe-app/lib/angular/angular.js:3519:19 at Object.getService [as get] (http://recipe-app/lib/angular/angular.js:3646:39) at http://recipe-app/lib/angular/angular.js:3524:45 at getService (http://recipe-app/lib/angular/angular.js:3646:39) at invoke (http://recipe-app/lib/angular/angular.js:3668:13) at Object.instantiate (http://recipe-app/lib/angular/angular.js:3689:23) at http://recipe-app/lib/angular/angular.js:6714:28 at link (http://recipe-app/lib/angular/angular-route.js:897:26) at nodeLinkFn (http://recipe-app/lib/angular/angular.js:6168:13) <div ng-view="" class="full-screen ng-scope"> 

See how all line numbers relate to lines in the angular.js file, and not to the source files? This leaves me wondering where my mistake is.

Note. I am not looking for a solution to this particular error. I am trying to figure out how to find the source of these errors using angular.

I already installed Batarang, but it does not show me this error at all. In addition, other SO answers show how to manually write error information to the console by inserting code in specific places, but this assumes I have a general idea where it comes from.

Thanks in advance, sorry for the dullness.

+6
source share
1 answer

This happens when any of your services are undefined. So check if all your services are included in index.html. In your case, I see that your home service was not found.

+4
source

All Articles