Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 792 Bytes

README.md

File metadata and controls

19 lines (16 loc) · 792 Bytes

Angular Service Dependency Injection Example

This is an coding exmaple of Single Responsibility Principle of a Class using a service and Dependency Injection for code reuse. Components use to display and present data. Services use to fetch the data from the API. Components should not fetchdata or save data. Rather they should focus on representing data and delegate data access to a Service. Services is a great way to share informaton among classes THAT DO NOT KNOW EACH OTHER. Therefore when you run across a scenario in which you need to use the same code across mulitple components.

How to Use this appliaction tutorial

  1. Clone down repo
  2. Run npm install
  3. Run ng serve

Technologies Used

Angular cli 7 Services

Jan 18, 2018   Rouz Majlessi
www.rouzm.com