pop element from array on selectionchange()

i am using angular. i have a multiple select (mat select) and i want to send the selected values in array i try to use selectionchange and get the value and push it in array but after that if i unselect an option that dosent pop from the array instead a value added in my array.i want if i unselect any element no new element inserted in that array

thanks in advance

  <mat-select  (selectionChange)="change($event)" multiple >
    <mat-option *ngFor="let i of user" [value]="i">
      {{ i.name }}

  change(event) {
    for(var i=0;i<this.e.length;i++)
      var local=this.e[i].value;

355 thoughts on “pop element from array on selectionchange()”

Leave a Comment