Thanks for reading this post.

I understand your struggle with Angular coming from different framework/library but as far as I know Angular (even with Ivy compiler) can't build template programmatically from the component. It surly has some disadvantages for not having this feature but I really like its idea of separating template from component logic. Like I mentioned in the post Angular provides several structural directives to help build dynamic templates. Now with Ivy you can lazy load the component on the fly. Maybe there will be a way in the future.

There're lots of alternative patterns to build templates dynamically. I usually build several small (dump) components to handle specific flows. Then have a container (smart) component that can determine which dump component will be rendered depending on which condition. I think this is a suggested approach Angular folks recommended.

Written by

Front End architect, opensource contributor and investment enthusiast. New content posted every week.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store