DEV Community


Angular 11 + Django MySQL CRUD example – Part 3: Angular Client

loizenai profile image loizenai ・3 min read

This tutorial is part 3 of Django-Angular-MySQL series. Today, we will create Angular Client to make HTTP request & receive response from Django Server.

>> Part 1: Overview
>> Part 2: Django Server


Angular Client Overview


The image below shows overview about Angular Components that we will create:


Project Structure


We have:
- 4 components: customers-list, customer-details, create-customer, search-customer.
- 3 modules: FormsModule, HttpClientModule, AppRoutingModule.
- customer.ts: class Customer (id, firstName, lastName)
- customer.service.ts: Service for Http Client methods
- app-routing.module.ts: Routing configuration

Setup Angular Project

Create Angular Project

Run command: ng new AngularDjango.

Create Service & Components

On Project folder, run commands below:
- ng g s customer
- ng g c create-customer
- ng g c customer-details
- ng g c customers-list
- ng g c search-customers
On each Component selector, delete app- prefix, then change tslint.json rules - "component-selector" to false.

Implement Angular Client App

Data Model

Create new file named customer.ts:

export class Customer {
    id: number;
    name: string;
    age: number;
    active: boolean;


Discussion (0)

Forem Open with the Forem app