July 2017
Intermediate to advanced
454 pages
10h 1m
English
A service in an Angular application is mostly used to supply data across the application and this data will be fetched from any service. In AngularJS, we have been using ngResource and %http to communicate with services and handling the data.
As part of the migration, we need to use the Angular HTTP module wherever we used ngResource and $http. To use the Angular HTTP module, we first need to import HttpModule and add it to the imports array in the NgModule directive of AppModule as follows:
import { HttpModule } from '@angular/http'; @NgModule({ imports: [ BrowserModule, UpgradeModule, HttpModule, ], }) export class AppModule { constructor(private upgrade: UpgradeModule) { } ngDoBootstrap() { this.upgrade.bootstrap(document.documentElement, ...Read now
Unlock full access