The Objective of this application is to understand the fundamentals of intepolation of data in angular after creating an array of employee objects and usage of ngIf
By the end of the assignment you should be able to understand
- Modules
- Components
- Array of objects
- ngFor and ngIf structural directive
- Fork the boilerplate repository.
- Clone the boilerplate repository and move into the project folder with cd command.
- Install dependencies
npm install
. - Run the code with
npm run start
which will run on port:4200.
Create an Angular application which will display the hard coded value for an employee object's array.
- We need to define an Employee class and create an array of objects of the Employee class in the parameterless constructor of Component class. Employee class will have following members.
variable | type |
---|---|
id | number |
firstname | string |
lastname | string |
address | string |
string | |
password | string |
gender | string |
date_of_birth | string |
- The Component class in this assignment will be having two members:
variable | type |
---|---|
title | string |
employee | Employee[] |
-
title will be having the value as
Registration details
. -
We will be having 4 employee objects with the data as follows:
`1,Raghav,Singh,A/22 Gaziabad,raghavsingh@gmail.com,raghav@123,Male,22-Aug-1990 2,Sujit,Kumar,Kanpur,sujitkumar@rediffmail.com,sujitkumar@123,Male,12-Nov-1981 3,Payel,Dutta,Kolkata,payeldutta@gmail.com,payel@123,Female,12-Mar-1985 4,Murali,Naidu,Chennai,muralinaidu@gmail.com,muralinaidu@123,Male,05-Jun-1989"`
- You are expecteded to display title with h1 header tag of HTML.
- Rest of the details should be displayed within a table and only the records of the male employees should be displayed.
- Ensure following commands succeed in your local machine -
npm install
npm run build
npm run lint
npm run test
npm run e2e
- [Angular Architecture] (https://angular.io/guide/architecture)
- [Angular CLI] ( https://cli.angular.io/)
- [Angular Templates] ( https://angular.io/guide/architecture#templates)
- [Angular Interpolation] ( https://angular.io/guide/template-syntax)