teraSurfer / angular-6-dependency-injection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency Injection Solution

Preqruisites

  1. Angular CLI Installed

Setup and Run

  1. Setup the application: npm install
  2. Run the application: npm run start

Solution Steps

  1. Create a ProductService that can be injected.
    • NOTE For this task, move the array of products definition into this service from the products.component
    • Create a method to be able to getAll products
    • Create a method to be able to get a single product by id
    • Create a method to be able to save a new or update an existing product
  2. Setup ProductsComponent to use ProductService
    • Use the OnInit LifeCycle event
    • Refactor handlers to be able to retrieve, post, update data from the service

About


Languages

Language:TypeScript 67.0%Language:HTML 26.2%Language:CSS 6.8%