将 'id' 和 'name' 都保存在 Angular 5
Save both 'id' and 'name' in Angular 5
使用 Angular 5、Material 组件和 Firebase 处理项目。是否可以通过一个字段存储两个值。
下面是我的代码,我从客户端 table 获取数据并在下拉列表中显示名称但存储 "client_id"。我想用 client_id.
存储 client_name
<mat-form-field>
<mat-select placeholder=" Select Client" formControlName="client_id" required>
<mat-option *ngFor="let cli of clientsarray; let i = index " [value]="cli.prodid">{{cli.fname}} {{cli.lname}}</mat-option>
</mat-select>
</mat-form-field>
绑定到对象,cli
在本例中。
<mat-option *ngFor="let cli of clientsarray; let i = index " [value]="cli">{{cli.fname}} {{cli.lname}}</mat-option>
使用 Angular 5、Material 组件和 Firebase 处理项目。是否可以通过一个字段存储两个值。 下面是我的代码,我从客户端 table 获取数据并在下拉列表中显示名称但存储 "client_id"。我想用 client_id.
存储 client_name<mat-form-field>
<mat-select placeholder=" Select Client" formControlName="client_id" required>
<mat-option *ngFor="let cli of clientsarray; let i = index " [value]="cli.prodid">{{cli.fname}} {{cli.lname}}</mat-option>
</mat-select>
</mat-form-field>
绑定到对象,cli
在本例中。
<mat-option *ngFor="let cli of clientsarray; let i = index " [value]="cli">{{cli.fname}} {{cli.lname}}</mat-option>