{"action":"created","issue":{"url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/19","labels_url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/19/comments","events_url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/19/events","html_url":"https://github.com/eHealthAfrica/angular-eha.couchdb-auth/issues/19","id":104452591,"number":19,"title":"Cannot read property 'getCurrentUser' of undefined","user":{"login":"danse","id":885935,"avatar_url":"https://avatars.githubusercontent.com/u/885935?v=3","gravatar_id":"","url":"https://api.github.com/users/danse","html_url":"https://github.com/danse","followers_url":"https://api.github.com/users/danse/followers","following_url":"https://api.github.com/users/danse/following{/other_user}","gists_url":"https://api.github.com/users/danse/gists{/gist_id}","starred_url":"https://api.github.com/users/danse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danse/subscriptions","organizations_url":"https://api.github.com/users/danse/orgs","repos_url":"https://api.github.com/users/danse/repos","events_url":"https://api.github.com/users/danse/events{/privacy}","received_events_url":"https://api.github.com/users/danse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-02T10:45:51Z","updated_at":"2015-09-02T14:09:06Z","closed_at":null,"body":"Hi i am updating the Sense dashboard in order to use this service, but i get an error when serving my app locally, where it is not minified. I get this error in console while the app is bootstrapping:\r\n```\r\nTypeError: Cannot read property 'getCurrentUser' of undefined\r\n    at ehaCouchDbAuthService.ngModule.provider.requireAuthenticatedUser (couchdb-auth.js:287)\r\n    at auth (routes.js:6)\r\n```\r\n[This is the part of my code](https://github.com/danse/sense-dashboard/blob/117/app/scripts/configuration/routes.js#L6) which is calling the auth provider, and [this is the line in the auth module which raises the exception](https://github.com/eHealthAfrica/angular-eha.couchdb-auth/blob/067010abd8595a616ccaa04c037100f8f2aabcd9/src/auth.service.js#L287). Inspecting it with the debugger, it seems that both `ehaCouchDbAuthService` and `$q` are undefined there, like if the dependency injection did not work.\r\n\r\nI am using the not minified version of the module, linked via Wiredep. Also the minified version leads to the same error.\r\n\r\nI am not sure how the dependencies should get injected there, maybe it is a new Angular feature? Or maybe i should have some Grunt task running on the dist files? I am using Angular `1.3.18`"},"comment":{"url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/comments/137094107","html_url":"https://github.com/eHealthAfrica/angular-eha.couchdb-auth/issues/19#issuecomment-137094107","issue_url":"https://api.github.com/repos/eHealthAfrica/angular-eha.couchdb-auth/issues/19","id":137094107,"user":{"login":"danse","id":885935,"avatar_url":"https://avatars.githubusercontent.com/u/885935?v=3","gravatar_id":"","url":"https://api.github.com/users/danse","html_url":"https://github.com/danse","followers_url":"https://api.github.com/users/danse/followers","following_url":"https://api.github.com/users/danse/following{/other_user}","gists_url":"https://api.github.com/users/danse/gists{/gist_id}","starred_url":"https://api.github.com/users/danse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danse/subscriptions","organizations_url":"https://api.github.com/users/danse/orgs","repos_url":"https://api.github.com/users/danse/repos","events_url":"https://api.github.com/users/danse/events{/privacy}","received_events_url":"https://api.github.com/users/danse/received_events","type":"User","site_admin":false},"created_at":"2015-09-02T14:09:06Z","updated_at":"2015-09-02T14:09:06Z","body":"aha, you are right! `when` will inject the value of `resolve`, so i need to pass the function directly. [This works](https://github.com/danse/sense-dashboard/blob/117/app/scripts/configuration/routes.js#L5), i will extend the doc"}}