1.0.0 • Published 7 years ago
ngx-injection v1.0.0
Component Injection 
Ngx component injection module.
Installation
npm install ngx-injectionapp.module.ts
import { InjectionModule } from 'ngx-injection'; 
... 
imports: [
    ...
    InjectionModule
    ...
] 
... Usage
import { InjectionService } from 'ngx-injection';
...
constructor(private _injectionService: InjectionService) { }
...
...
const ref = this._injectionService.injectComponent(TestComponent, {
	inputs: {
	    myInput: 'Hello From Test'
	}, 
    outputs: {
	    myOutput: (e) => { console.log('Hello From Test') }
	}
}, this.template.nativeElement);
...Configuration
/**
* Component injection options interface.
*/
interface InjectionOptions {
    /**
    * Componenet inputs.
    */
    inputs?: any;
    
    /**
    * Component Outputs
    */
    outputs?: any;
}Notice
**The component which will be injected must be located in entryComponents.
License
1.0.0
7 years ago