【发布时间】:2019-12-11 11:28:34
【问题描述】:
我正在尝试运行此代码
<mat-header-cell *matHeaderCellDef mat-sort-header class="header-primary-text"> Response </mat- header-cell>
<mat-cell *matCellDef="let element">
<!-- Code for new questions and dropdown - Ramki -->
<!-- mat-form-field style="width: 48%" -->
<div *ngIf="element.name == 'Select the complexity of Application'">
<mat-select [(ngModel)]="element.QuestionCode" placeholder="Select the complexity"
<mat-option *ngFor="let qc of element.QuestionCode" value="{{qc}}">
{{qc}} </mat-option>
</mat-select>
</div>
我收到如下错误:
意外的结束标记“mat-option”。标签有时可能会发生 已经被另一个标签关闭。有关更多信息,请参阅 https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags
("-option *ngFor="let qc of element.QuestionCode" value="{{qc}}"> {{qc}} [ERROR ->]</mat-option> </mat-select> </div>
我哪里出错了?
我是 Angular 的新手。感谢任何帮助
【问题讨论】:
-
当您的 HTML 未正确关闭时会发生这种情况。
-
现在检查更正的代码。关闭标签未正确关闭。
-
标签未正确关闭:末尾缺少 >(在占位符属性之后)。 -
HI Aviboy:我在哪里可以找到更正的代码?
标签: angular