If a parent component needs to send data to a child component, which property decorator should be used?

  • @ViewChild
  • @Input
  • @Output
  • @ContentChild
To send data from a parent component to a child component in Angular, you should use the @Input property decorator. It allows the parent component to bind data to a property of the child component. The other options, such as @ViewChild, @Output, and @ContentChild, serve different purposes, like accessing child elements or emitting events.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *