I have this plunker example https://embed.plnkr.co/RtZvxv2rPFpLPZGndS0g/ where I have two components created on the fly: ContentComponent and HeaderComponent. I want to reference the HeaderComponent selector in the ContentComponent template like this:
ngOnInit() {
this.template = "<div>This is the {{ name }}</div><app-header></app-header>";
this.compileTemplate();
}
Unfortunately this is not working and the compiler complains: app-header is not a known element.
Does anyone have an idea how to solve this problem? Is there another way to obtain the same end result?