[英]Unexpected closing tag “div” error angular2 HTML
我在控制台中遇到了一些错误,并且不确定HTML
的问题是什么。 任何帮助,将不胜感激。
error_handler.js:51 EXCEPTION:未捕获(在保证中):错误:模板解析错误:意外结束标记“div”(“单击此处注册[错误 - >]”):ResetPassword @ 22:1错误:模板解析错误:意外的结束标记“div”(“单击此处注册[ERROR - >]”):ResetPassword @ 22:1
<section class="reset-password">
<div class="container container-responsive inner-top-xs">
<form [formGroup]="resetPasswordForm" (ngSubmit)="resetPassword(resetPasswordForm.value, resetPasswordForm.valid)">
<h4>Please enter your e-mail address and a temporary password will be sent to you.</h4>
<div class="form-group">
<label class="control-label" for="email">Email</label>
<input type="text" formControlName="email" required class="form-control" id="email" placeholder="Email">
<validation-message [control]="resetPasswordForm.controls.email"></validation-message>
</div>
<button type="submit" class="btn btn-flat__blue outer-top-xs" [disabled]="!resetPasswordForm.valid">RESET PASSWORD</button>
</form>
<div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage"">
<button type="button" class="close" data-dismiss="alert">×</button>
{{errorMessage}}
</div>
<div class="alert alert-dismissible alert-success outer-top-xs" *ngIf="successMessage">
<button type="button" class="close" data-dismiss="alert">×</button>
{{successMessage}}
</div>
<div class="outer-top-xs">
<a [routerLink]="['/getstarted']">Click here to Signup</a>
</div>
</div>
</section>
在*ngIf="errorMessage && !successMessage""
你有一个双引号太多了:
<div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage">
<!--at the end of this line-->
打开元素但不关闭它时发生此错误。 此示例中显示此错误:
<ion-list *ngSwitchCase="'facilities'">
<ion-item *ngFor="let facility of facilities">
<ion-icon name="facility.Icon" item-start></ion-icon>
{{facility.Name}}
<ion-icon color="red" name="rose" item-end></ion-icon>
</ion-item>
<ion-list>
如你所见,我没有关闭<ion-list>
元素(应该是</ion-list>
)
小心:
如果您使用任何元素属性及其值,因为解析器无法处理它们,则将打开该元素并发生此错误(在上面的示例中为“”)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.