You can use ngDoBootstrap hook for a manual bootstrapping of the application instead of using bootstrap array in @NgModule annotation. This hook is part of DoBootstap interface.
1 2 3 | interface DoBootstrap { ngDoBootstrap(appRef: ApplicationRef): void } |
The module needs to be implement the above interface to use the hook for bootstrapping.
1 2 3 4 5 | class AppModule implements DoBootstrap { ngDoBootstrap(appRef: ApplicationRef) { appRef.bootstrap(AppComponent); // bootstrapped entry component need to be passed } } |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.