This App is a Simple Angular 6 App which uses
- Angular Components
- HTTP Client
- Angular Routing
- Services
- Very Basic Bootstrap
- Communication from parent to child component
This Applications template can be copied and used to build other bigger applications.
The CSS used is very basic since the main aim of this project is to focus on angular 6
This is the link where the app is deployed.
This Application has just two pages.
- A Customer List Page which Lists out all the Customers
- A Customer Details Page which will display the Details for the Selected Customer
Refer https://nodejs.org/en/ to install NodeJS
Use the following command to install angular CLI
npm install -g @angular/cli
Refer https://cli.angular.io/ to know more about angular CLI
Clone the repo into local
Open the project folder and install the npm packages using the following command
npm install
In Order to Run the Application Type the following command in command prompt
npm start
The Application runs on localhost:4200
The Components Created are
-
CustomersComponent : This Component Is to Display the List of Customers
-
CustomerdetailsComponent : This Component Displays the Details for a Single Selected Customer
-
DisplayComponent : This Component Displays the Customer name Clicked in the CustomersComponent ( The whole point for this component is to demonstrate parent to child component communication ). This is a child component of CustomersComponent
The Services Created are
- DataService : All the Jsons used in the application are stored in assets/samplejson folder. DataService Helps in getting the Json from the assets/samplejson folder Using a Http Request . In Real Applications , the Service Helps to Get the Data from a Rest API or any other API by making a HTTP Request
Model Classes Used are
-
Customer : This is the model class used for the CustomersComponent to define the structure of each customer in the list
-
CustomerDetails : This is the model class used for CustomerdetailsComponent to define the structure containing all the customer details
Routing Module is used to Route between the 2 pages in the application The 2 paths used in the routing module are
-
/customers : This url displays the customer list and points to CustomersComponent
-
/customerdetails/id : This url displays the details for each customer and points to CustomerdetailsComponent
Refer to https://angular.io/guide/quickstart to get an understanding of how angular 6 works