Closed DavidSegura closed 1 year ago
Sorry, but I'm not sure I understand the problem. :(
After rereading the problem. I understand better. Sorry.
You want an × to reset the value to the original one. But what you are asking is a special case. If the input value is a value like 2
, the × will no longer be consistent.
There should be an added option that resets to a given value.
Hi :D
I am implementing a dynamic component for some filters and I am using the ng-select 2 library.
The problem I have is the following, I declare a reactive form:
`private ngFormBuild(): void { let formFilter: FormControl[] = [];
} ` Then in the template I implement the selector:
` <ng-container *ngIf="f.type == FiltersEnum.select"> <select2 [attr.id]="f.label" [data]="ngGetSelect(f.label)" [resettable]="true" formControlName="{{ f.label }}" (update)="ngSubmit()"
Then I select a value in the selector:
And now when I delete the selection, the filter changes to undefined.
I don't know if I'm doing something wrong. But shouldn't it return to the value of the FormControl?
Thank you very much for your time