Introduction
ngAfterViewInit runs code after the component's view is fully loaded. It helps you work with elements or child components safely.
You want to access or change HTML elements after they appear on screen.
You need to call a method on a child component after it is ready.
You want to start animations or measurements that require the view to be visible.
You want to set focus on an input field after the page loads.