I\'m trying to build my own service by following the example in the documentation for the factory methodology. I think I\'ve done something wrong however because I continue
Since this is the first Stackoverflow question that appears on Google when searching for Error: $injector:unpr Unknown Provider
I'll add this here.
Make sure that in your index.html any modules/dependencies are not being loaded after they are needed.
For example in my code customFactory.factory.js
begins like this:
angular
.module("app.module1")
.factory("customFactory", customFactory);
However the index.html looked like this:
Where it should've really looked like this:
Since customFactory.factory.js
is declared as part of module1
, it needs to be loaded before customFactory