Error: [$injector:unpr] Unknown provider: LoginServiceProvider <- LoginService <- LoginCtrl

Hi,

Another issue here not sure whey i am having so much issues with this

and getting this error

Error: [$injector:unpr] Unknown provider: LoginServiceProvider <- LoginService <- LoginCtrl
http://errors.angularjs.org/1.5.3/$injector/unpr?p0=LoginServiceProvider%20%3C-%20LoginService%20%3C-%20LoginCtrl
minErr/<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:13438:12
createInjector/providerCache.$injector<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:17788:19
getService@http://localhost:8100/lib/ionic/js/ionic.bundle.js:17941:39
createInjector/protoInstanceInjector<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:17793:28
getService@http://localhost:8100/lib/ionic/js/ionic.bundle.js:17941:39
injectionArgs@http://localhost:8100/lib/ionic/js/ionic.bundle.js:17965:58
instantiate@http://localhost:8100/lib/ionic/js/ionic.bundle.js:18007:18
$controller@http://localhost:8100/lib/ionic/js/ionic.bundle.js:23412:18
self.appendViewElement@http://localhost:8100/lib/ionic/js/ionic.bundle.js:59900:24
ionicViewSwitcher.create/switcher.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:57893:29
ionicViewSwitcher.create/switcher.init@http://localhost:8100/lib/ionic/js/ionic.bundle.js:57813:11
self.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:59759:5
self.register@http://localhost:8100/lib/ionic/js/ionic.bundle.js:59717:5
updateView@http://localhost:8100/lib/ionic/js/ionic.bundle.js:65398:11
.compile/</<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:65375:11
$RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:8100/lib/ionic/js/ionic.bundle.js:30718:15
transitionTo/$state.transition<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:52157:11
processQueue@http://localhost:8100/lib/ionic/js/ionic.bundle.js:29127:28
scheduleProcessQueue/<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:29143:27
$RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8100/lib/ionic/js/ionic.bundle.js:30395:16
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8100/lib/ionic/js/ionic.bundle.js:30211:15
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8100/lib/ionic/js/ionic.bundle.js:30503:13
done@http://localhost:8100/lib/ionic/js/ionic.bundle.js:24824:36
completeRequest@http://localhost:8100/lib/ionic/js/ionic.bundle.js:25022:7
requestLoaded@http://localhost:8100/lib/ionic/js/ionic.bundle.js:24963:9
consoleLog/<()ionic.bundle.js (line 26794)
$ExceptionHandlerProvider/this.$get</<(exception=Object { type="object"}, cause=undefined)ionic.bundle.js (line 23507)
$RootScopeProvider/this.$get</Scope.prototype.$broadcast()ionic.bundle.js (line 30720)
transitionTo/$state.transition<()ionic.bundle.js (line 52157)
processQueue(state=Object { type="object"})ionic.bundle.js (line 29127)
scheduleProcessQueue/<()ionic.bundle.js (line 29143)
$RootScopeProvider/this.$get</Scope.prototype.$eval(expr=Object { type="object"}, locals=undefined)ionic.bundle.js (line 30395)
$RootScopeProvider/this.$get</Scope.prototype.$digest()ionic.bundle.js (line 30211)
$RootScopeProvider/this.$get</Scope.prototype.$apply(expr=undefined)ionic.bundle.js (line 30503)
done(status=200, response="<ion-view view-title="Lo...n-content>\n</ion-view>\n", headersString="Accept-Ranges: bytes\r\nDa...\r\nContent-Length: 697\r\n", statusText="OK")ionic.bundle.js (line 24824)
completeRequest(callback=Object { type="object"}, status=200, response="<ion-view view-title="Lo...n-content>\n</ion-view>\n", headersString="Accept-Ranges: bytes\r\nDa...\r\nContent-Length: 697\r\n", statusText="OK")ionic.bundle.js (line 25022)
requestLoaded()ionic.bundle.js (line 24963)
// ionic.bundle.js (line 26794)
return logFn.apply(console, args);

can anyone help?

thanks

your pen is incorrect, you are referencing js files that are not accessible from CodePen

Hi, well i have placed all code in JS as i couldn’t place 3 separate files to show you guys so placed all files code into JS like

/* App.js files code */

please check that and let me know if you need anything else

any update sir ? i am really waiting for reply because i am just stuck on it now

Hi,

I am not 100% sure this is the problem. However I declare a new ‘service’ the syntax I use is

You currently have:

.service('LoginService', function($q) { ... });

What I typically do is:

.factory("LoginService",function($q) {...});

The change was to update “.service” to “.factory”.

Hope this helps or fixes your problem. I just recently ran into an issue with a similar error being thrown but for a different issue of data providers not being declared in parent states.

Thanks!

that i tried already Bro but did’t fix the issue, do you want me to send you the JS and everything if you want to look into it, please let me know !

Alguien ha solucionado este problema?

Bueno he resuelto el problema, resulta que no se debe llamar los servicios en el archivo de app.js de ionic, si no en la dependencia de los controladores que es ahí donde se utilizan.

It works relly fine with me. Thanks for the suggestion. Please keep posting more.