Angular 6 Get and Post Request - Http Client
Posted at: October 19, 2018 12:36 PM
Step 1:
Create class blogpost
blogpost.ts
Step 2:
Create blogs service.
Import HttpClient, HttpHeaders, HttpErrorResponse, throwError, catchError and Blogpost into blogs.service.ts.
blogs.service.ts
Step 3:
Create blogs component
Step 4:
Import HttpClientModule and FormsModule into app.module.ts
app.module.ts
Step 5:
Load blogs component on app.component.html
app.component.html
Step 6:
Edit Blogs Component