ex: I have ['a', 'b', 'c'] in the select tags, then ['b'] is chosen, I want the next select tag contains only ['a', 'c']
TS file:
orderSelect() { //get all documents from db
this.orderService.orderSelect().subscribe(data => {
this.orderArray = new MatTableDataSource(data);
this.orderArray.sort = this.sort;
this.orderArray.paginator = this.paginator;
});
}
HTML file:
<mat-form-field>
<mat-select formControlName="productId" matInput placeholder="Product" #productId required>
<mat-option *ngFor="let a of productArray" value="{{ a._id }}" (click)="getPrice(i, a.productPrice, a.productQuantity); getTotal(i)">{{ a.productName }}</mat-option>
</mat-select>
</mat-form-field>