DynamicComponentLoader is now deprecated and doesn't fire events propely.
Use ComponentResolver with ViewContainerRef.
import { Directive , Input, OnInit, ComponentResolver,ViewContainerRef }
from '@angular/core';
@Directive({
selector:'[yourSelector]'
})
export class YourDirective
I know this reply is a little late to the party, however it was one of the
bigger issues that I just faced and overcame and this thread was one of the
top results in google. (Though I understand we're now in a later build of
Angular2)
I just managed to get a similar functionality to ng-include
Hey Pete, sadly ng-include (or similar) won't be
added https://github.com/angular/angular/issues/2753
The most you'll have is Custom Renderers
See
https://github.com/angular/angular/issues/1807
https://docs.google.com/document/d/1M9FmT05Q6qpsjgvH1XvCm840yn2eWEg0PMskSQz7k4E/edit#
And
Eric,
That is too bad. Angular2 was looking really good for us until this snag.
This may force us to revisit React, since their component life-cycle model
fits very well with a metadata-driven UI. Imagine the *props *of a React
component containing the metadata specifying the view. The *render