It’s alive! Dynamic components in Angular
summary
Runtime selection of actual component instances replaces huge ngSwitch templates by resolving factories with ComponentFactoryResolver or directly inserting via ViewContainerRef.createComponent, and lazy-loading separate lazy-loaded NgModule bundles so only needed component code ships. Demo shows dynamically added widgets with working change detection, reachable inputs and output subscriptions; notes lifecycle caveat (ngOnChanges not auto-run for raw instance members). Also mentions Angular Elements and upcoming Ivy as alternative simplifications.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:02Demonstrating the concept
- 4:13Static vs. dynamic components
- 8:28Use cases and applications
- 12:24Angular instantiation logic
- 13:57Implementing basic dynamics
- 17:03Lazy loading and plugins
- 20:41Conclusion and resources








