In which of the following situations would you use an @Input() decorator in a component?
- To define local variables
- To emit custom events from the component
- To inject services into the component
- To pass data from a parent component
The @Input() decorator is used when you need to pass data from a parent component to a child component, allowing the child to receive input data.
Loading...
Related Quiz
- What is the purpose of the setValue and patchValue methods in Angular Reactive Forms?
- What is the primary purpose of Dependency Injection (DI) in Angular?
- You're building an e-commerce application and want to create a nested navigation structure where product categories have sub-categories. How would you design the routing for this scenario using child routes?
- To handle errors within an Observable chain, you can use the _____ operator in RxJS.
- To add a third-party library to an Angular project, you can use the _____ command of Angular CLI.