The demo to create a dynamic component shows an error in the console in dev mode
https://angular.io/guide/dynamic-component-loader
https://angular.io/generated/live-examples/dynamic-component-loader/eplnkr.html
I've fixed it by adding a setTimeout
to the ngAfterViewInit -> loadComponent
call.
I'd like to know the correct way to handle a simple example like this without generating the error, and without using setTimeout