PrimeNG was created for enterprise applications. Implementing a CRUD (create, read, update, and delete) scenario is easily done. The example in this section demonstrates such a scenario with employees that are taken as domain model objects. Employees can be fetched, created, updated, and deleted. All CRUD operations happens via Angular's HTTP service, which communicates with a mock backend. We will improve our CRUD implementation later on in the section Introduction to state management with @ngrx/store.
The domain model object Employee is defined using the following interface:
export interface Employee {
id: string;
firstName: string;
lastName: string;
profession: string;
department: string;
}
The mock backend is not shown here because it is beyond the scope of this book.
The complete demo application with instructions is available on GitHub at
https://github.com/ova2/angular-development-with-primeng/tree/master/chapter9/crud-datatable...
https://github.com/ova2/angular-development-with-primeng/tree/master/chapter9/crud-datatable...