Angular 13 JSONPlaceholder API HTTPClient Module Example to Fetch Posts and Display it Using ngFor Directive & Services

 

 

Create Angular App

 

 

ng new app

 

 

cd app

 

 

Import HttpClientModule in Angular App

 

 

 

 

Create Post Service

 

 

ng g s services/post

 

 

 

post.service.ts

 

 

 

 

app.component.ts

 

 

 

 

app.component.html

 

 

 

 

Now if you open the angular app at localhost 4200

 

 

Leave a Reply