Jquery 将值传递给mat select以选择该选项

Jquery 将值传递给mat select以选择该选项,jquery,angular,angular-material,Jquery,Angular,Angular Material,您需要使用相同的变量在mat-select中输入ngModel和name。例如: this.valueTipDoc=this.data1.idPath[0].doctype.toString(); 可能opt.name不等于valueTipDoc的值。例如,如果valueTipDoc=“Document Red”,则需要在opt.name中使用“Document Red” this.valueTipDoc=this.data1.idPath[0].doctype.toString();

您需要使用相同的变量在mat-select中输入ngModel和name。例如:

  this.valueTipDoc=this.data1.idPath[0].doctype.toString();

可能opt.name不等于valueTipDoc的值。例如,如果valueTipDoc=“Document Red”,则需要在opt.name中使用“Document Red”
  this.valueTipDoc=this.data1.idPath[0].doctype.toString();
    [(ngModel)]="valueTipDoc" name="valueTipDoc"