This is an application implemented with the basic functionality of an ecommerce application. Users can
- View the list of products available.
- View more details of a selected product.
- Add selected product to cart.
Product list, Product and Cart are three different components to increase modularity of the application. Angular router is used for navigation. On navigating to the application product list is shown.
Once an item is selected router navigates to Product component.
Services are used to retrieve product list from the API and to manage cart.
- Create a new angular project.
- Generate components ProductList, Product and Cart
- Add angular routing to navigate between the pages.
- In ProductList component the list of products is shown including buttons to navigate to selected product.
- In Product compenent detailed information on a product is shown including a button to navigate back to product list and a button to add the product to cart.
- Nav bar is added to navigate to home (product list) or cart from anywhere in the applicatioin.
- In Cart component the list of items added to the cart are shown including the total cost of the items.
- Dependency injection principle to is used to share data between components using services which supports loose coupling of components.
- In ProductService product details are retrieved from the url as an observable and in components where observerbale is subscribed are unsubscribed in OnDestroy.
Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.
Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.


