Angular 2 – Return data directly from an Observable
Since http calls and the like are async, you get an Observable instead of a synchronous value returned. You have to subscribe to it, and in the callback in there you get the data. There is no way around that. One option would be to place your logic in the subscribe call getSomething() { return … Read more