Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
injector: Injector,
viewContainerRef: ViewContainerRef
) {
const ngComponentOutlet = this._ngComponentOutlet = new NgComponentOutlet(viewContainerRef);
/* @HACK: This hack wraps `DynamicDirective` hacks.
* Creating a fake `ComponentOutletInjectorDirective` that will allow
* `DynamicDirective` to grab `componentRef` from `NgComponentOutlet`. */
const componentOutletInjector: any = {
get componentRef() {
return ngComponentOutlet['_componentRef'];
}
};
this._dynamicDirective = new DynamicDirective(
injector,
injector.get(IoService),
DynamicComponent as any,
componentOutletInjector
);
}