I create a user and now I want to login the user after this operation. I was using toPromise() but now I just want to use observables:
return this.httpClient.post('/user', user)
.map(response => response.json() as User)
.catch(this.handleError);
With promises I could do this
return this.create(data)
.then(function(user: User) {
return self.login(user.email, user.password);
})
.then(function(resp: loginStuff) {
// set session
})
How can I chain with observables?