2017-01-05 17 views
7

Konsolda bazı hatalar alıyorum ve sorunun HTML içinde olduğundan emin değilim. Herhangi bir yardım takdir edilecektir.Beklenmeyen kapatma etiketi "div" hatası angular2 HTML

error_handler.js:51 EXCEPTION: Uncaught (in promise): Error: Template parse errors: Unexpected closing tag "div" (" Click here to Signup [ERROR ->] "): [email protected]:1 Error: Template parse errors: Unexpected closing tag "div" (" Click here to Signup [ERROR ->] "): [email protected]: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">&times;</button> 
     {{errorMessage}} 
    </div> 
    <div class="alert alert-dismissible alert-success outer-top-xs" *ngIf="successMessage"> 
     <button type="button" class="close" data-dismiss="alert">&times;</button> 
     {{successMessage}} 
    </div> 
    <div class="outer-top-xs"> 
     <a [routerLink]="['/getstarted']">Click here to Signup</a> 
    </div> 
</div> 
</section> 

cevap

8

Sen *ngIf="errorMessage && !successMessage"" az bir çift tırnak çok fazla var:

<div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage"> 
<!--at the end of this line--> 
+0

"Yazım hatası" yakın nedenini kullanmanın daha iyi bir örneği var. –

+0

@torazaburo ohhh, öyle bir şey var mı? Bilmiyordum! :) o zaman evet, kesinlikle doğru – PierreDuc

+0

Oh benim. Teşekkür ederim. – Cookies

1

, bir öğeyi açmak ve kapatmak yok Bu hata oluştu.

herhangi eleman özelliklerini kullanıyorsanız: Eğer ben <ion-list> elemanı kapatmayın Görüldüğü üzere

<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> 

dikkatli olun (</ion-list> olmalıdır): Bu hata bu örnekte gösterir ayrıştırıcı olarak değerlerini işleyemez, öğe açılır ve bu hata oluşur ("yukarıdaki örnekte").