Getting Data

JSON placeholder content

The first step to consume https services, is to go to app.module

Make HttpClient available everywhere in the application in two steps. First, add it to the root AppModule by importing it:

import { HttpClientModule } from '@angular/common/http';

Next, still in the AppModule, add HttpClientModule to the imports array:

@NgModule({
  imports: [
    HttpClientModule,
  ],
})

Console.log the data from server

Display data from server

Was this page helpful?