I was trying to implement (blur) with ng-select multiple with checkboxes,so the everytime I change my model I will not be making api calls .API calls will be made only when ng-select is out of focus. Api will be called on (blur) . But when I click on checkbox which is defined inside ng-select only using ng-template it is triggering the blur event. I want to emit only on blur.
<div style="width: 100%" tabindex="0" >
<ng-select #mySelect class="custom" [style]="{'height':'10px', 'width':'100%','border':'2px'}"
[items]="lookup.investorKnowledgeSource.asArray"
[multiple]="true"
[closeOnSelect]="false"
[(ngModel)]="it.source"
placeholder="Select Source Of Knowledge Product"
[clearable]="false"
(ngModelChange)="onChangeKnowledgeSource($event,it)"
(blur)="change.emit()"
>
<ng-template ng-multi-label-tmp >
<span><b>()Selected</b></span>
</ng-template>
<ng-template ng-option-tmp let-item="item" let-item$="item$" let-index="index">
<input id="item-" type="checkbox" [ngModel]="item$.selected" [disabled]="item.disabled"/>
</ng-template>
</ng-select>
</div>
Aucun commentaire:
Enregistrer un commentaire