Closed hamzawii closed 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
@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
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.
<delete-icon (click)="categoryInput.onRemoveRequested(item, index)"></delete-icon>
removeItem
Thanks, that's correct
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)
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