I am still trying to teach myself Angular2 (and I really need to find some better resources) but I have a question. I have moved my data calls to a service and I am using Re
I would subscribe to the loginInUser
observable to be notified when the current user is updated:
constructor(public userDataService: UserDataService) {
this.userDataService.loginInUser.subscribe(
(currentUser) => {
console.log(currentUser);
}
});
}
Don't forget that an HTTP request is asynchronous so you can receive data after the constructor of your App
component is executed.