Throughout this tutorial, we’ll be learning how to build an Angular 11 CRUD application with Bootstrap 4 styles to consume a REST Web API, create, read, modify, and search data.

Introducing our Angular 11 CRUD Application

We will learn how to build an Angular 11 front-end application that fetches data from a REST API of products:

  • Each product has id, name, description, availability status.
  • Users would be able to create, retrieve, update, and delete products.
  • Users can search for products by name.

The REST API Endpoints

We’ll be building a Angular 11 frontend app for a presumed REST API exporting the following REST API endpoints:

  • POST /api/products create new product
  • GET /api/products retrieve all products
  • GET /api/products/:id retrieve a product by :id
  • PUT /api/products/:id update a product by :id
  • DELETE /api/products/:id delete a product by :id
  • DELETE /api/products delete all products
  • GET /api/products?name=[keyword] find all products which name contains the passed keyword.

All of them can work well with this Angular App.

Angular 11 CRUD App Structure

These are the components of our CRUD app:

  • The App component is the parent of all other components and contains a router-outlet directive where the router will be inserting any matched component. It also contains a navigation bar that contains links to the app routes using routerLink directive.

– ProductListComponent which displays the list of products.

– ProductUpdateComponent which displays a form for editing product’s details by :id.

– ProductCreateComponent which displays a form for creating a new product.

The components use the ProductService methods for actually making CRUD operations against the REST API. The service makes use of Angular 11 HTTPClient to send HTTP requests to the REST and process responses.

#angular #angular-11 #bootstrap 4

How to Create Angular 11 CRUD with Bootstrap 4
115.00 GEEK