To capture changes in the @Input() property, one should implement the ______ interface.
- AfterViewInit
- OnChanges
- OnDestroy
- OnInit
To capture changes in the @Input() property, one should implement the OnChanges interface. The OnChanges lifecycle hook provides a method, ngOnChanges, which is called whenever any of the input properties of a component change. This allows you to react to input changes.
Loading...
Related Quiz
- You have a requirement to dynamically load a component at runtime based on user actions. Which tools or concepts in Angular would you utilize to accomplish this?
- What would be a primary reason to use a Subject over a standard Observable in RxJS?
- How can you configure the Angular CLI to generate components with inline templates and styles by default?
- When testing asynchronous operations in Angular, which utility can be used to handle asynchronous tasks inside test specs?
- You're building an e-commerce application and want to navigate the user to a "Thank You" page after a successful purchase. Which Angular feature would be most appropriate to use for this type of navigation?