I'll admit I do like the thought of having the ability in the future to dynamically load components based around more complex logic in our TS rather than bloating our HTML with it.
It paves the way for BuilderComponents that can generate views based on what information we pass to it.
Think of taking FormBuilder one step further to FormBuilderComponent where we give it our FormGroup and it renders the appropriate form controls based on the structure of our FormGroup.
My gripe right now is that, yes, our dynamically loaded component can style itself, but it does not currently have the ability to style where it lives/renders in its parent and its parent loses its ability to style where its dynamic children render.
With Content Projection using ng-content, we at least maintain the ability to decide where our children get rendered and how the area surrounded them gets styled.
👨🏫 Co-Founder of This is Learning, Organizer of AarhusJS
✍️ Writer, Speaker, FOSS Maintainer 📗 Author
🏆 Microsoft MVP 🌟 GitHub Star
🌊 Nx Champion 🦸 Angular Hero of Education
This ASP.NET-style school of thought was part of the original Angular 2 design doc, but features such as FormLayoutComponent never made the final cut, neither did built-in state management and quite a few other features.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'll admit I do like the thought of having the ability in the future to dynamically load components based around more complex logic in our TS rather than bloating our HTML with it.
It paves the way for BuilderComponents that can generate views based on what information we pass to it.
Think of taking
FormBuilder
one step further toFormBuilderComponent
where we give it ourFormGroup
and it renders the appropriate form controls based on the structure of ourFormGroup
.My gripe right now is that, yes, our dynamically loaded component can style itself, but it does not currently have the ability to style where it lives/renders in its parent and its parent loses its ability to style where its dynamic children render.
With Content Projection using
ng-content
, we at least maintain the ability to decide where our children get rendered and how the area surrounded them gets styled.This ASP.NET-style school of thought was part of the original Angular 2 design doc, but features such as FormLayoutComponent never made the final cut, neither did built-in state management and quite a few other features.