Back

Fix Angular ViewChild Not Available in ngOnInit

Problem

ViewChild is undefined in ngOnInit because view is not initialized yet.

Code Editor