I am trying to dynamically creating a component based on a template
In My code
component.ts
var factories = Array.from(this.componentFactoryResolver['_factories'].keys());
let factoryClass = <Type<any>>factories.find((x: any) => x.name === this.comp);
let componentFactory = this.componentFactoryResolver.resolveComponentFactory(factoryClass);
let componentRef = this.theBody.createComponent(componentFactory);
In development environment
factories===>
..............
function CranchecklisttemplateComponent(cran) {
this.cran = cran;
this.componentlist = [];
this.model = {};
}
.............
After ng build
factories===>
..............
function t(t){this.cran=t,this.componentlist=[],this.model={}}
}
.............
why function parameters are miss matched after ng build.I am using aot build false in my project.