I have a mat-select where the options are all objects defined in an array. I am trying to set the value to default to one of the options, however it is being left selected
Try this!
this.selectedObjectList = [{id:1}, {id:2}, {id:3}] this.allObjectList = [{id:1}, {id:2}, {id:3}, {id:4}, {id:5}] let newList = this.allObjectList.filter(e => this.selectedObjectList.find(a => e.id == a.id)) this.selectedObjectList = newList