CRUD sample implementation with DataTable
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.
Note
The complete demo application with instructions is available on GitHub athttps://github.com/ova2/angular-development-with-primeng/tree/master/chapter9/crud-datatable.
The...