JamesRandall / AngularJS-OAuth2

Package for allowing an AngularJS application to authenticate with an OAuth 2 / Open ID Connect identity provider using the implicit flow.
MIT License
46 stars 42 forks source link

[$injector:modulerr] Failed to instantiate module #44

Closed kevinlbatchelor closed 7 years ago

kevinlbatchelor commented 7 years ago

I don't know if you are keeping this project up to date, but it dosn't seem to be working anymore.

I cant load the module..., this is error I get in the chrome console:

[$injector:modulerr] Failed to instantiate module

here is my main.js file:

var myApp = angular.module("myApp", ['afOAuth2']);

kevinlbatchelor commented 7 years ago

looks like a problem with the directive. If I inject your modules individually they work; For example this works, note the directive is left out.

var myApp = angular.module("myApp", [ 'oauth2.accessToken', 'oauth2.endpoint', 'oauth2.interceptor']);

kevinlbatchelor commented 7 years ago

OK, the problem is that you have a dependency on $routeProvider. This could be added to your bower.json. Otherwise it needs to be installed using NPM Bower or otherwise. Then added to ones angular.modules

bower install angular-route

JamesRandall commented 7 years ago

Can you let me know which version of Angular you're using? I'm not aware of any issues but 1.6 came out the other day. I'm using it with 1.6 myself but did have to make a fix for it.

kevinlbatchelor commented 7 years ago

Thanks i figured it out.

JamesRandall commented 7 years ago

Thanks - I'll add that to bower.json and package.json.