CRUD #1 Admin can View Blog List - Angular 6 / Angular 7

Posted at: December 15, 2018 6:10 PM

Blog Model

Create a Blog class in its own file in the src/app/models folder.

Define field in Blog class

Blog Service

Create blog service in services folder.

Import Blog, HttpClient, HttpErrorResponse, throwError, catchError into src/app/services/blog.service.ts

Service file src/app/services/blog.service.ts

Update AuthInterceptor

Open AuthInterceptor file src/app/http-interceptors/auth-interceptor.ts and replace this code { Authorization: `Bearer ${authToken}` } to { Authorization: authToken }

Manage Blog Component

Import BlogService and Blog into src/app/admin/manage-blogs/manage-blogs.component.ts

Open component html file src/app/admin/manage-blogs/manage-blogs.component.html

Update in API

Open Api controller and create method adminBlogs for blog listing.

Get header and match token for authorized user.

Open model file Api_model and create methods get_admin_blogs and checkToken

You can watch video on CRUD #1 Admin can View Blog List - Angular 6 / Angular 7

CRUDLoginLogouttokenWeb APIAuthenticationGuardInterceptors

Please click below YouTube button for subscribe my channel truecodex for latest videos.

Angular Project Login - username: admin and password: admin

Angular 6/7 Tutorial in Hindi

Angular 7 is a JavaScript based framework for building web applications and apps in JavaScript, html, and TypeScript, which is a superset of JavaScript, used to create Single Page Applications. provides video tutorial for enough understanding of all the necessary components of Angular 6 and Angular 7. will keep uploading videos of the latest features of Angular. Please subscribe my channel for latest videos.

Please leave comments

Speed Up Your Magento Store by 300%

Angular Templates

React Templates

Magento 2 Templates

truecodex launched free android app. You can download and install truecodex app on your mobile and get notification of the latest post.

Video Tutorials on YouTube