can';t装订';ngModel';也不渲染角材质“angular 6”中的“mat select”

can';t装订';ngModel';也不渲染角材质“angular 6”中的“mat select”,angular,typescript,angular-material,angular6,angular8,Angular,Typescript,Angular Material,Angular6,Angular8,我在应用中使用角材料,Mat select根据循环和某些条件多次显示 我需要在ngAfterViewInit()中的mat select中默认选择数据 循环哪个cteate多个mat选择 *ngFor="let p of GlobalVariableService.controllsApplicationTypeFields;let filedIndex = index " 我正在创建多个mat选择代码 <div class="mt-3 example-full-width"

我在应用中使用角材料,Mat select根据循环和某些条件多次显示 我需要在ngAfterViewInit()中的mat select中默认选择数据

循环哪个cteate多个mat选择

*ngFor="let p of GlobalVariableService.controllsApplicationTypeFields;let filedIndex = index "
我正在创建多个mat选择代码

<div class="mt-3 example-full-width"
                                *ngIf="(p.FK_FieldType == '6') && p.FK_PanelId == k.PanelId">
                                <div *ngFor="let list of  GlobalVariableService.listSelectData">
                                    <mat-form-field *ngIf="list.id == p.FieldId" class="w-95">
                                        <mat-select matNativeControl name="ApplicationStatusId"
                                            [(ngModel)]="GlobalVariableService.controllsApplicationTypeFields[filedIndex].DefaultValue"
                                            required>
                                            <mat-option *ngFor="let l of list.FieldListItems" [value]="l.ItemId">
                                                {{GlobalVariableService.isEn === true ? l.FieldText : l.FieldTextAr}}
                                            </mat-option>
                                        </mat-select>
                                    </mat-form-field>
                                </div>
                            </div>

{{GlobalVariableService.isEn==true?l.FieldText:l.FieldTextAr}
Ts代码是

 for (var ls = 0; ls < this.GlobalVariableService.controllsApplicationTypeFields.length; ls++) {
              if (Control == this.GlobalVariableService.controllsApplicationTypeFields[ls].FieldId) {
                 this.GlobalVariableService.controllsApplicationTypeFields[ls].DefaultValue = this.GlobalVariableService.ApplicationValues[i].Value;
                debugger;
                console.log("selected value is");
                console.log(this.GlobalVariableService.controllsApplicationTypeFields[ls].DefaultValue);
              }
            }
for(var ls=0;ls
如果在itemid中显示值,则itemid在ngModel中是正确的,但不会渲染Mat select 请帮忙,也许吧


我还使用了[value]标记来代替NGModel非常感谢您的回答,但下拉列表是绑定列表我在设置其默认值时遇到了问题。那么,您是否100%确定GlobalVariableService.ControlsApplicationTypeFields[filedIndex]。DefaultValue等于l.ItemId?你能把它记录下来吗(console.log,span..)?
import { FormsModule } from '@angular/forms';

@NgModule({
    imports: [
         FormsModule      
    ]