Hi all.

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.

Search Discussions

  • Michael Wulf at Aug 29, 2014 at 10:41 pm
    Tiago,

    There must be more to this than the error line you've provided. Presumably
    there is a longer stack trace. Also, did you include the simpleLogin
    service mentioned in the comments?

    If those don't help, provide some more context for us, preferably a small
    sample that reproduces the error which we could try out.

    Cheers,

    On Thu, Aug 28, 2014 at 6:49 PM, Tiago Garcia wrote:


    Hi all.

    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
    <https://groups.google.com/d/msgid/firebase-angular/3a873984-cdcf-4b2d-80d9-7e765325de73%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    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/CAFHX4%3Dpx3WuBeawgLF8%3DXmOMPq1AgjZt2tLNvcZE%3Dy4UaPOu6A%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedAug 29, '14 at 5:54p
activeAug 29, '14 at 10:41p
posts2
users2

2 users in discussion

Tiago Garcia: 1 post Michael Wulf: 1 post

People

Translate

site design / logo © 2021 Grokbase