In angularfire documention, appears something like this:
1. app.config(["$routeProvider", function($routeProvider) {
2. $routeProvider.when("/home", {
3. controller: "HomeCtrl",
4. templateUrl: "views/home.html",
5. resolve: {
6. // controller will not be loaded until $getCurrentUser resolves
7. // simpleLogin refers to our $firebaseSimpleLogin wrapper in the example above
8. "currentUser": ["simpleLogin", function(simpleLogin) {
9. // $getCurrentUser returns a promise so the resolve waits for it to complete
10. return simpleLogin.$getCurrentUser();
11. }]
12. }
13. })
14. }]);
15.
16. app.controller("HomeCtrl", ["currentUser", function(currentUser) {
17. // currentUser (provided by resolve) will contain the
18. // authenticated user or null if not logged in
19. }]);
well, my question is, how can I pass the 'currentUser' to the controller if debugger keeps saying this:
Error: [$injector:unpr] Unknown provider: currentUserProvider <- currentUser.
Can you please share an example?
Thanks in advance,
Cheers.
--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/3a873984-cdcf-4b2d-80d9-7e765325de73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.