如何添加具有相同mat-form-field内容副本的动态行(stepper中的此表)

时间:2019-04-03 09:45:22

标签: angular angular-material

我要添加具有相同td的行应重复。因为我需要“元数据键”和“元数据”的多个值。

<tr>
                    <td>
                        <mat-form-field class="example-full-width">
                            <input [(ngModel)]="metaDataKey" matInput formControlName="metaDataKey"
                                   autocomplete="off"
                                   placeholder="Meta Data Key">
                        </mat-form-field>
                    </td>

                    <td>
                        <mat-form-field class="example-full-width">
                            <mat-chip-list #metaDataChipList>
                                <mat-chip *ngFor="let term of metaData" [selectable]="selectable"
                                          [removable]="removable" (removed)="remove(term, metaData)">
                                    {{term}}
                                    <mat-icon matChipRemove *ngIf="removable">cancel</mat-icon>
                                </mat-chip>
                                <input name="metaData" placeholder="Meta Data"
                                       [matChipInputFor]="metaDataChipList"
                                       [matChipInputSeparatorKeyCodes]="separatorKeysCodes"
                                       [matChipInputAddOnBlur]="addOnBlur"
                                       (matChipInputTokenEnd)="add($event)">
                            </mat-chip-list>
                        </mat-form-field>
                    </td></tr>

0 个答案:

没有答案