我有一个动态模板,我收到一个错误,指出:
Template parse errors: Unexpected closing tag "button". It may happen when the tag has already been closed by another tag.
这是我的模板:
<ion-col>
<button *ngIf=!editMode" class="warning-gradient" (click)="toggleEdit()"><i class="fa fa-edit"></i>Update</button>
<button *ngIf="editMode" class="warning-success" (click)="submitForm()"><i class="fa fa-check"></i>Update</button>
</ion-col>
。我应该做一些不同的事情吗?
您在第一个<button>
上缺少 *ngIf
属性的开头"
<ion-col>
<button *ngIf="!editMode" class="warning-gradient" (click)="toggleEdit()"><i class="fa fa-edit"></i>Update</button>
<button *ngIf="editMode" class="warning-success" (click)="submitForm()"><i class="fa fa-check"></i>Update</button>
</ion-col>