FSD-II Practical 3
3.Create a custom life-cycle hook for logging component life-cycle events - Define a custom life-cycle hook named `LogLifecycle` that logs component initialization, destruction, and changes in input properties. - Implement the custom hook in a sample component. - Test the behavior by adding the component to a parent component and observing the logs. 1. ng new practical3 2. cd practical3 3. ng generate service log-lifecycle 4. open the file log-lifecycle.service.ts import { Injectable , OnInit , OnDestroy , OnChanges , SimpleChanges } from '@angular/core' ; @ Injectable ({ providedIn: 'root' }) export class LogLifecycle implements OnInit , OnDestroy , OnChanges { constructor () { co...