I tried to ngModel bind value in mat-select dropdown.I have some value in options ex: A - A/C Loss, B - BURGLARY. Once i checked option checkbox i need to bind only A,B remove A/C Loss and BURGLARY.
This is options value example:
This is ngModel bind value example:
Need to exactly result in ngModel: A,B,CF,CI,CM,CR
Code Example:
<mat-select placeholder="Select Events" [formControl]="selectEventitems" [(ngModel)]="selectedEventValue" (change)="onEventsChange($event)" (focus)="onEventfocus($event)" multiple>
<mat-option class="select-all" value="SelectAll">Select All</mat-option>
<mat-option *ngFor="let event of getAllEvents" [value]="event.eventrpt_id">{{event.eventrpt_id}} - {{event.descr}}</mat-option>
</mat-select>