This repository contains the implementation of the employee management task, built with Angular.
Version: Angular 21+
Reasoning:
- Standalone Components: Removes
NgModuleboilerplate, simplifying the application structure and speeding up development. - Control Flow Syntax: Utilizes the new syntax (
@if,@for) instead of legacy directives (*ngIf,*ngFor) for better readability and performance. - Performance: The newer build system (esbuild/vite) provides faster start-up times and smaller bundle sizes.
Main CSS Framework: Tailwind CSS
- Reason: Utility-first approach allows for rapid styling directly in HTML without switching files. It provides a consistent design system and is extremely lightweight in production (removes unused CSS).
Component Library: Flowbite
- Reason: Used for interactive elements like Modals, and form elements. These are fully compatible with Tailwind but do not burden the application like Angular Material.
The application is designed with an emphasis on Smart/Dumb (Container/Presentational) architecture and Service-based communication.
-
AppComponent(Smart):- Responsible for loading data via
EmployeesService. - Manages the state of the list .
- Reacts to events emitted by child components (filter changes, edit actions).
- Responsible for loading data via
-
EmployeeFilterComponent(Dumb):- Pure presentational component.
- Displays search inputs and status dropdowns.
- Emits filter values to the parent (
@Output() filterChange).
-
EmployeeListComponent(Dumb):- Receives the list of employees as input (
@Input() employees). - Handles sorting logic visually and emits sort events.
- Emits actions like "Edit" or "Delete" to the parent (
@Output() edit,@Output() delete).
- Receives the list of employees as input (
-
EmployeeFormComponent(Smart):- Form for adding/editing an employee.
- Uses Reactive Forms for validation and handles the save logic directly with the service.
EmployeesService: State management for employee data (Observable streams).ModalService: Controls the visibility and content of modal windows.