I am coming from Angular1, and like chaining promise, I want to have similar behavior.
I have a method in someclass:-
{.........
doLogin (username, password) {
.......
.......
return this.http.get(api).subscribe(
data => {.....}, //enters here
err => {.....}
}
Then I am calling this method :-
someclass.doLogin(username, password).subscribe(
data => { }, //Not getting called
err => { }
}
As I mentioned as comments on the above code, the subscribe is not getting called in the caller class.
Any suggestion about how to do this ?