We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Get angular component type
Create component that will use DynamicComponentClass and create new DynamicComponent and use component type instead of any
// default.component.ts import { Component, ComponentFactoryResolver } from '@angular/core'; import { component, DynamicComponentClass } from '@ngx-core/common'; import { DynamicComponent } from './dynamic.component' @Component({ selector: 'default-component', template: '<div #container></div>' // create #container variable }) export class DefaultComponent extends DynamicComponentClass { public model = {}; public key = 'notdefined'; constructor(componentFactoryResolver: ComponentFactoryResolver) { super(componentFactoryResolver); } public create(component: component): void { // <--- use component type instead of any this._create(component); } }