In my component I return the template code using Reflect
this.http.get(Reflect.getMetadata('annotations', TemplateComponent)[0].templateUrl)
.map((res:Response) => res.text())
.subscribe(
data => {
console.log( data);
},
err => console.error(err),
() => console.log('done')
);
then I add Dynamically a component and I call this http.get method to return the template text after adding a component dynamically
resolver.resolveComponent(component).then((factory) => {
componentRef = target.createComponent(factory);
}); // this method permit to add a component dynamically
so I need to get the template code with updating component