I am new to Angular2/4. I want to dynamically create DOM element from back end value with predefined templates and embed this collective template at some location of my existing template. How I can do this?
My Scenario: In my existing component's template, I have various if cases, for each condition I have different template. In future these if conditions will increase. So I want to use factory class which will provide the template depending on my condition and then I want to insert this newly created template in my existing template. So that in future I dont need to change my parent template. all I need to do is to insert corresponding template in factory class and that template will get added automatically in my parent template.