Angular 4 ng-content select not working on dynamically created transcluded elements

Viewed 2524

I am using the ComponentFactoryResolver to dynamically create an element to be inserted into my template, which uses ng-content for transclusion.

It all works wonderfully until I add a select attribute to my ng-content. Please see this plunker which demonstrates the problem. If I remove the content-top attribute from my HeaderComponent template on line 63 of app.ts, the template renders as expected.

I do however need to use select because there are two different template fragments to be injected so I can't simply remove it.

Any help appreciated.

1 Answers
Related