What is the primary use of the @Input() decorator in a component?

  • To declare a component
  • To declare a service
  • To declare a variable
  • To declare an Angular module
The primary use of the @Input() decorator in a component is to declare a variable as an input property. This allows data to be passed into the component from its parent component. Input properties enable communication between components, making it possible to send data from a parent component to a child component. It is not used to declare services, components, or Angular modules.
Add your answer
Loading...

Leave a comment

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