Complete the code to import the lifecycle hook that runs after Angular sets input properties.
import { Component, [1] } from '@angular/core';
The OnChanges hook runs after Angular sets or resets input properties.
Complete the code to implement the lifecycle hook that runs once after the first ngOnChanges.
export class MyComponent implements [1] { ngOnInit() { console.log('Init'); } }
The OnInit hook runs once after the first ngOnChanges and is used for component initialization.
Fix the error in the lifecycle hook name that runs after Angular projects external content into the component.
export class MyComponent implements AfterContentInit { ngAfterContent[1]() { console.log('Content projected'); } }
The correct method name is ngAfterContentInit, which runs after content projection.
Fill both blanks to complete the lifecycle hook that runs after Angular initializes the component's views and child views.
export class MyComponent implements [1] { ng[2]() { console.log('View initialized'); } }
The interface and method are both AfterViewInit and ngAfterViewInit, which run after view initialization.
Fill both blanks to complete the lifecycle hook that runs just before Angular destroys the component.
export class MyComponent implements [1] { ng[2]() { console.log('Cleanup before destroy'); } }
The interface is OnDestroy, the method is ngOnDestroy, which runs before component destruction.