Thursday, May 24, 2018

Angular: 7 methods to share data between components

Angular introduces a lot of structure to web "single page apps",
based on object-oriented components, modules, services etc
to enable creating robust and responsive web apps.
The price is initial complexity of setting up a system,
and the communication between parts of the system.

Make It Easy: Share data between Angular components - 7 methods
7 different ways for sharing data between Angular components.
  1. Share data between parent and child component
  2. Share data between components using ViewChild
  3. Share data between sibling components
  4. Share data between components using service file | Communicate between components using service file
  5. 3 simple ways to share data through angular route.
  6. Create reusable component and pass data to component
  7. Share data between non related components (via service)