Taranys / ng-selector

Custom select to replace ng-select component based on selectize.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error on AOT

abelkbil opened this issue · comments

Your selector plugin contribution is working fantastic. Especially dynamic fetch.

I got error while building with aot. Without aot it is fine no error.

<ng-selector 
    name="company"
    [(ngModel)]="company_selected"
    [formControl]="loanApplyForm.controls['company']"
    (loadValues)="fetchHLCompany($event)"
    id-field="id" label-field="name"
    [options]="company_values"
    allow-creation="true"
    placeholder="Search you company">
</ng-selector>

import { NgSelectorModule } from 'ng-selector';

@NgModule({
  imports: [
    CommonModule,
    OwlModule,
    FormsModule,
    NgbModule.forRoot(),
    //NgSelectizeModule,
    // TagInputModule,
    BrowserAnimationsModule,
    NgSelectorModule
  ],

ERROR in C:/xampp/htdocs/EMI2/Developments/angular/emi/src/$$_gendir/node_modules/
ng-selector/src/ng-selector.component.ngfactory.ts (1,1): Property 'multiple' is p
rivate and only accessible within class 'NgSelectorComponent'.

I think we need to remove private properties, necessary for ng aot.
@Attribute('multiple') public multiple = false,

Yes you right !
I just publish a new version on NPM with the fix you suggested => 2.0.2.

Can you try it ?