Chapter 3. The Collector Service - Using Controllers to Collect Data
In this chapter, we are going to take the Collector component to the next level and add some business logic to it. As we saw earlier in the preceding chapter, components are simple TypeScript classes with properties and methods. Each component has a view and can communicate with that view in any directions:
- From component to template
- From template to component
- Or simultaneously in both directions
The properties in a component class are basically data holders for a view and the methods implement what views intend to do (the behavior of the view). These methods are mostly triggered by the template events. However, there are scenarios where a story happens outside of the component/template relationship. Lets find out more about it.
The main topics of this chapter are:
- Services and how they are beneficial to our project
- Dependency injection framework
- Various types of bindings in Angular
- Firebase Realtime database