Rajdeep Saha

Rajdeep Saha

  • 1.6k
  • 170
  • 27.7k

How to dynamically inject component in Angular2 ?

Mar 12 2018 8:59 AM
In my current work, I have a requirement. We using Angular2 with HTML5 and CSS for frontend design. Now we navigate from one UI to another UI using Angular2 route using Single Page Application Concept. Now One of the UI under project is related to Member Information where there is a Country Dropdown. On Depend on the selected Value of the Country dropdown, We developed multiple component on basis of the country type. What is need on selection of the Country Code, I need to inject any one of the those component just after the country dropdown. Country wise which component need to open will be configured by user or admin itself. I know ngIf is one of the solution. Is there any other Solutions for inject component dynamically in UI using Angular2 ? 

Answers (1)