错误TypeError:无法读取未定义的属性“标签”

时间:2019-05-10 06:41:40

标签: typescript angular-material angular6

在控制台上用角度6显示“错误TypeError:无法读取未定义的属性'label'”错误时发生。
控制台错误为here

我表单中的代码显示在下面

                      <div class="row">
                          <!-- <div class="col-md-6"> -->
                              
                              <div class="col-md-6">
                                    <mat-form-field >
                                            <textarea matInput placeholder="Description" ngModel name="address" #address='ngModel' [ngModel]="des"></textarea>
                                        </mat-form-field>
                              </div>
                              
                          <!-- </div> -->
                          
                          <div class="col pull-right">
                              <div class="row">
                              <div class="col-md-2 pull-right"><strong>Priority</strong></div>
                              <div class="col-md-4">
                                <mat-slider thumbLabel #priority name="priority" type="number" min="1" max="5" step="1" value="{{priority_id}}" [(ngModel)]="priority.value" ></mat-slider>
                              </div>
                              
                                <div class="badge badge-pill badge-secondary badge-priority">
                                    {{priority.value}}
                                 </div>
                                </div>

                      <div class="row">    
                            <div class="col-md-2"><strong>Severity</strong></div>
                            <div class="col-md-4">
                            <mat-slider thumbLabel  #severity name="severity" min="1" max="5" step="1" value="{{severity_id}}" [(ngModel)]="severity.value" ></mat-slider>
                    </div>

                      <div class="badge badge-pill badge-secondary badge-priority">
                          {{severity.value}}
                       </div>
                  
                  </div>
                </div> </div>
                    <div class="col-md-4 pull-right">
                        <mat-form-field>
                          <mat-label>Job Type</mat-label>
                          <select matNativeControl ngModel name="type_id" #type_id='ngModel' #type_id
                                         [(ngModel)]="t_id" [value]="type">
                                    <option *ngFor="let job of jobtype" value="{{job.id}}">{{job.type}}</option></select>
                        </mat-form-field>
                      </div>

0 个答案:

没有答案