Manual Component Bootstrapping In Angular — Dynamically
I have created this project to understand how to bootstrap a specific component in Angular and that too dynamically.
The answer is YES. There is a hook in Angular which helps us achieve this.
i.e. DoBootstrap.
DoBootstrap Hook is for manual bootstrapping of the application instead of using bootstrap array in @NgModule annotation. This hook is invoked only when the bootstrap array is empty or not provided.
Check the demo out and let me know if it helps you too.
Run npm install
and then ng serve
for a dev server. Navigate to http://localhost:4200/
. The application will automatically reload if you change any of the source files.
Cheers!!
Sangwin Gawande
About me : https://sangw.in