Hi,
on my angular application users can authenticate to enter the website.
When user login to my app, all user informations are stored in a service : 
userService in order to be accessible by all controllers.

The problem is the following, we use ngroute for browsing:


app.config(function($routeProvider, $locationProvider) {
 
    $routeProvider.when('/userinfo', {
            title: 'Informations utilisateur',
            templateUrl: '/views/userinfo.html',
            controller: 'userCtrl',
            resolve: {
                userServ: ['userService', function(userService){
                    return userService;
                }]
            }
        })
});


And when config is fired, the application has not yet run() so my userService 
is not yet instantiated, well i think (im not sure)
Which means that when I go to the / userinfo page and I use in my userCtrl all 
the data in userService are empty ..

As you see I have attempted to force the instantiation of the service into the 
resolve .. but nothing does ...

Finally, I just want the userService to be instantiated from the start so that 
all my controllers can access the information of the logged in user if needed.

Someone to help me? thanks in advance



-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to