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 ...

Get Angular Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.