Gbuomprisco / ngx-chips

Tag Input component for Angular
MIT License
902 stars 359 forks source link

Error when built AOT --PROD #840

Closed hamzawii closed 5 years ago

hamzawii commented 5 years ago
[x] bug report 
[ ] support request/question

Notice: feature requests will be ignored, submit a PR if you'd like

Current behavior ng build --prod fails : Property 'removeItem' is private and only accessible within class 'TagInputComponent'

Minimal reproduction of the problem with instructions (if applicable)

<tag-input [ngModel]="['@item']" [modelAsStrings]="true" #input>
    <ng-template let-item="item" let-index="index"> <!-- DEFINE HERE YOUR TEMPLATE -->
        <span>
            item: {{ item }}
        </span>
        <delete-icon (click)="input.removeItem(item, index)"></delete-icon>
    </ng-template>
</tag-input>

Build ng build --prod

Package Version

@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 7.0.5 @angular/cli 7.0.5 @angular/flex-layout 7.0.0-beta.19 @ngtools/webpack 6.1.5 @schematics/angular 7.0.5 @schematics/update 0.10.5 rxjs 6.3.3 typescript 3.1.6 webpack 4.9.2

Angular version: 7.0.3

ngx-chips version: 2.0.0-beta.0

Browser: N/A

maximilianmeier commented 5 years ago

you can use <delete-icon (click)="categoryInput.onRemoveRequested(item, index)"></delete-icon> instead. its a public function and it actually just calls removeItem wrapped in a promise.

Gbuomprisco commented 5 years ago

Thanks, that's correct