The @angular/http module provides a way to access external APIs and web services using HTTP requests in an Angular application. It provides functions like get(), post(), put() and delete() for making requests and getting responses from the API.
Here are some code examples using Http get() method to retrieve data from an external API:
1. Using Observable and Subscribe:
import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import { Observable } from 'rxjs/Observable';
Package library: @angular/http is a native module in Angular framework, we don't need to install any external package for it.
TypeScript Http.get - 30 examples found. These are the top rated real world TypeScript examples of @angular/http.Http.get extracted from open source projects. You can rate examples to help us improve the quality of examples.