1

I am trying to dynamically creating a component based on a template

More infomation

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.

Sangwin Gawande
  • 7,658
  • 8
  • 48
  • 66
wannacry
  • 11
  • 2

0 Answers0