Lesson 301
Injecting Custom Services
This Lesson’s Focus
- Learn how to use services to isolate ‘business logic’ away from your components
At CoderGirl
- ABC Lesson 301 (StackBlitz)
Workshop
in VS Code
- First,
git commit
- Then, practice creating a service in your project using the CLI (
ng g s AwesomeFeature
). - Add a method to the service that logs a message to the console
- Inject the service into a component
- Call the method on the service. Make sure you see the console log.
- Undo the changes by running
git checkout .