viewContainerRef?:ViewContainerRef;// the parent of the component
componentType:any;// the component class
inputs?:{[key:string]:any};// a list of inputs to provide to the component @Input
outputs?:{[key:string]:Function};// a list of output callbacks to provide to link with the component @Output
index?:number;// the position where to inject your component
}
NgxDOMComponentService
Into your app.component.ts file, you must include the NgxDOMComponentService and then call init, or at least before any calls to the ngx-dom-component methods/constructor, etc...
Create a new NgxDOMComponent and inject it onto the dom.
NgxEntryComponent (Decorator)
In some case (ex: when compiling in AOT mode) the metadata properties are lost and the binding of the inputs/outputs becomes impossible. As a result you wont see your inputs changes (ngOnChanges) and the outputs wont be binded. If you encounter this situation, you can use the decorator NgxEntryComponent and provide directly the list of properties as inputs and outputs
@NgxEntryComponent({
inputs:['message']
outputs: []
})
@Component({
selector:'my-component',
template:'some html'
})
exportclassMyComponent{
@Input()
publicmessage:string;
//...
}
NgxDOMComponentContainer
Create a wrapper for the ViewContainerRef, allowing you not providing the viewContainerRef attribute of NgxDOMComponentCreateOptions.