I found the Problem. 

I defined in my modules the service in the providers. the objects are 
single instances, not singletons.

Am Dienstag, 14. März 2017 18:27:45 UTC+1 schrieb Marco Gall:
>
>
> Hello,
>
> i wan't to use the same loginServers, exactly the userdata from the 
> service in different modules.
>
> In one Module Login, i do the loginprocess. in the loginmodule and another 
> module (navigation) i will consume the data. In navigation i will hide some 
> navigationoptions. 
> All data are placed in my Loginservice. 
>
> <div>
>    <Navigation></Navigation>
>    <Login></Login>
> </div>
>
> export class LoginService {
>     private url = 'api/login/';
>     loggedIn: boolean = false;
>  
>     loginName: string = '';
>     password: string = '';
>     userName: string = '';
>     error: string = '';
>
>         Login() { ... }
>
>     Logout() { ... }
>
> }
>
>
> I used Login() in my LoginModule. the Login changed the loggedIn if 
> successful. In Navigation i need the loggedin, but it hold on inititialvalue. 
>
>
> I used for both module the same constructor. 
>
> constructor(private loginService: LoginService) { }
>
> I read in every documentation, that loginService is DI and this is Singleton 
> in Angular2. But my bindings dont update by data. where can help me?
>
>
> Sorry for my bad english.
>
>
>

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

Reply via email to