[英]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.