I am trying to inject component dynamically based on the value selected by the user in a dropdown.
My requirement is that whenever a user changes the value of drop-down and click on view component gets injected but again if the user changes the dropdown value and clicks on view same injected component should be re-rendered but instead one new component gets injected.
Is there any way we can achieve this.
Note: on dropdown change, a service is called and different data will be returned from the server.
Stackblitz for the issue: https://stackblitz.com/edit/angular-cszxfs?file=src%2Fapp%2Fapp.component.ts
Thanks in advance