ngCourse2 icon indicating copy to clipboard operation
ngCourse2 copied to clipboard

Component Communication Patterns

Open e-schultz opened this issue 8 years ago • 0 comments

  • Describe patterns of component communication (parent/child)
  • Example of when you would want an instance of a service per-component instead of singleton
  • Use of @Host parameter decorator

ost services that people create can be fine as singletons for the application, however there can be times when having an instance per-component can be useful. We don't really cover this other than to say that it can be done. A use case that Nik has been working on is handling errors

<error-container> <-- has a service that is insanced per error-container, not singleton
  <individual-error></individual-error> - uses @Host to get access to the service for communication
</error-container>

If we can get a way of making this easy to explain/digest - could be a useful addition.

e-schultz avatar Sep 12 '16 21:09 e-schultz