In which lifecycle hook should data fetching be initiated?
- A constructor
- B ngOnInit
- C ngAfterViewInit
- D ngOnDestroy
Answer
ngOnInit
The constructor should only assign injected dependencies. ngOnInit runs after the first inputs are bound, making it the right place for initialisation.





