How we can establish communication between two components ? In This video I am explaining all 7 possible ways to create interaction between two angular components.

You will find the code here : https://github.com/beingsagir/angular-component-interactions

  • 3:05 Pass data from parent to child with input binding
  • 8:30 Intercept input property changes with a setter
  • 13:15 Intercept input property changes with ngOnChanges()
  • 19:09 Parent listens for child event
  • 23:25 Parent interacts with child via local variable
  • 27:27 Parent calls an @ViewChild()
  • 31:15 Parent and children communicate via a service

  1. Pass data from parent to child with input binding

Image for post

  1. Intercept input property changes with a setter

Image for post

  1. Intercept input property changes with ngOnChanges()

Image for post

  1. Parent listens for child event

Image for post

  1. Parent interacts with child via local variable

Image for post

  1. Parent calls an @ViewChild()

Image for post

  1. Parent and children communicate via a service

Image for post

#angular #javascript #programming #developer #web-development

7 Ways Angular Components Can Share Data
40.80 GEEK