Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
  • Overview
  • Transcript

1.2 How to Use the Angular 2 HTTP Service

In this lesson, I’ll show you how to use the HTTP service to request external data in Angular 2. If you’ve used Angular 1, you’ll notice that the HTTP service has changed a lot. The main difference is that information returned from HTTP is now in the form of an Observable.

The following snippet shows how to retrieve data with Angular 2’s HTTP service and Observable operators.

getSamples (){
    return this.http.get(this.url)
        .map(this.extractData)
        .catch(this.handleError);
}

Related Links

1.How to Use the Angular 2 HTTP Service
2 lessons, 09:21

Free Lesson
1.1
Introduction
01:11

1.2
How to Use the Angular 2 HTTP Service
08:10