1
rated 0 times
[
8]
[
7]
/ answers: 1 / hits: 120902
/ 8 Years ago, fri, may 6, 2016, 12:00:00
On the Angular 2 documentation page for using the Http service, there is an example.
getHeroes (): Observable<Stuff[]> {
return this.http.get(this.url)
.map(this.extractData)
.catch(this.handleError);
}
I cloned the angular2-webpack-starter project and added the above code myself.
I imported Observable
using
import {Observable} from 'rxjs/Observable';
I'm assuming the properties Observable
are imported as well (.map
works). Looked at the changelog for rxjs.beta-6 and nothing is mentioned about catch
.
More From » angular