A clean and modern Angular data table component that fetches data from an API, displays it in a table, and includes features like sorting, filtering, and pagination.
- Description
- Setup Instructions
- Design Decisions
- Packages
- Live Link
- Specifications
- Testing
- Known Bugs
- Support
- License
This project is an Angular-based implementation of a reusable data table component that fetches data from a REST API and displays it in a structured table format. The component includes:
- Core Features:
- Fetching data from an API using Angular's
HttpClient
. - Displaying the data in a well-structured HTML table using Angular's
*ngFor
directive. - Handling loading states to indicate when data is being fetched.
- Implementing error handling to gracefully display error messages if the API request fails.
- Fetching data from an API using Angular's
- Advanced Features:
- Sorting: Click on column headers to sort the data.
- Filtering: Use the search input to filter the table rows by
name
oremail
. - Pagination: Navigate through pages of data using "Previous" and "Next" buttons.
- Styling:
- Clean and modern UI with Montserrat font and Font Awesome icons.
- Responsive design for better usability.
- Node.js (v18 or higher)
- Angular CLI (v17 or higher)
- Git (Version Control)
- Clone the repository:
git clone https://github.com/DynastyElvis/angular-data-table.git cd angular-data-table
Here’s the pure Markdown version of your content, ready to copy and paste into a README.md
file:
## **Install dependencies:**
```bash
npm install
ng serve
http://localhost:4200
- Reusable Component: The
DataTableComponent
is designed to be reusable and can be easily extended for additional features. - Error Handling: Errors are caught and displayed gracefully, ensuring a good user experience.
- Styling: The UI uses a clean and modern design with Montserrat font and Font Awesome icons.
- Responsive Design: The table is responsive and works well on both desktop and mobile devices.
- Angular: Core framework for building the application.
- Font Awesome: For icons (search, sorting arrows).
- RxJS: For handling asynchronous data fetching.
- Angular HttpClient: For making API requests.
- Fetches data from an API and displays it in a table.
- Allows sorting by clicking on column headers.
- Filters data using a search input and dropdown.
- Paginates data for better navigation.
- API endpoint:
https://jsonplaceholder.typicode.com/users
- Search input: Filters by
name
oremail
. - Dropdown: Filters by
username
.
- Displays a table with
ID
,Name
,Email
, andUsername
. - Shows loading and error states.
- Manual Testing:
- Tested sorting, filtering, and pagination functionality.
- Verified loading and error states.
- Unit Testing:
- Unit tests can be added using Angular's
TestBed
andJasmine
.
- Unit tests can be added using Angular's
- None at the moment. Please report any issues here.
For support, contact:
- Email: kipkemoilvs@gmail.com
This project is licensed under the MIT License. See the LICENSE file for details.