Im trying to create a plugin that takes a component as argument and render its content in the end of body tag. Just like the plugins that work with jQuery.
@Component({
selector: 'some-selector',
template: 'This is FirstComponent'
})
class FirstComponent{}
@Component({
selector: 'app',
template: 'The root component'
})
class AppComponent{
// ImaginaryModalOpener is what i want to achieve.
// a standalone function that can take a component and render it in dom
// at the bottom of the body tag
ImaginaryModalOpener(FirstComponent);
}
I have seen a lot of stackoverflow questions about rendering a dynamic components but they use directives or HTML markup in the root Component to start with. In my case the Root template will have no directives or components for ImaginaryModalOpener.
Please point out if i've missed something.