意外的结束标记“div”错误angular2 HTML

前端之家收集整理的这篇文章主要介绍了意外的结束标记“div”错误angular2 HTML前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在控制台中遇到了一些错误,并且不确定HTML中的问题是什么.任何帮助,将不胜感激.

error_handler.js:51 EXCEPTION: Uncaught (in promise): Error: Template
parse errors: Unexpected closing tag “div” (” Click here to Signup
[ERROR ->] “): ResetPassword@22:1 Error: Template
parse errors: Unexpected closing tag “div” (” Click here to Signup
[ERROR ->] “): ResetPassword@22:1

  1. <section class="reset-password">
  2. <div class="container container-responsive inner-top-xs">
  3. <form [formGroup]="resetPasswordForm" (ngSubmit)="resetPassword(resetPasswordForm.value,resetPasswordForm.valid)">
  4. <h4>Please enter your e-mail address and a temporary password will be sent to you.</h4>
  5. <div class="form-group">
  6. <label class="control-label" for="email">Email</label>
  7. <input type="text" formControlName="email" required class="form-control" id="email" placeholder="Email">
  8. <validation-message [control]="resetPasswordForm.controls.email"></validation-message>
  9. </div>
  10. <button type="submit" class="btn btn-flat__blue outer-top-xs" [disabled]="!resetPasswordForm.valid">RESET PASSWORD</button>
  11. </form>
  12. <div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage"">
  13. <button type="button" class="close" data-dismiss="alert">&times;</button>
  14. {{errorMessage}}
  15. </div>
  16. <div class="alert alert-dismissible alert-success outer-top-xs" *ngIf="successMessage">
  17. <button type="button" class="close" data-dismiss="alert">&times;</button>
  18. {{successMessage}}
  19. </div>
  20. <div class="outer-top-xs">
  21. <a [routerLink]="['/getstarted']">Click here to Signup</a>
  22. </div>
  23. </div>
  24. </section>

解决方法

在* ngIf =“errorMessage&&!successMessage”“你有一个双引号太多:
  1. <div class="alert alert-dismissible alert-danger outer-top-xs" *ngIf="errorMessage && !successMessage">
  2. <!--at the end of this line-->

猜你在找的CSS相关文章