Unexpected closing tag “div” error angular2 HTML

前端 未结 2 817
日久生厌
日久生厌 2020-12-20 12:12

I\'m getting some errors in the console and not sure what is the issue is in the HTML. Any help would be appreciated.

error_handler.js:51

相关标签:
2条回答
  • 2020-12-20 12:45

    You've got one double quote too many at *ngIf="errorMessage && !successMessage"":

    <div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage"> 
    <!--at the end of this line-->
    
    0 讨论(0)
  • 2020-12-20 13:09

    This error occurred when you open an element and don't close its. this error shows up in this example:

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

    As you see I don't close <ion-list> element (should be </ion-list>)

    Be careful:

    If you use any element properties with its values as the parser can't handle them, the element will be opened and this error occurs( "" at above example).

    0 讨论(0)
提交回复
热议问题