<div class="form-field">
<label>Confirm Password: </label>
<input type="text" formControlName="confirm" [(ngModel)]="signup.confirm" name="confrim">
<div *ngIf="!signupForm.valid">
<span *ngIf="signupForm.get('confirm').hasError('confirmPassword') && signupForm.get('confirm').touched">
{{signupForm.get('confirm').errors?.confirmPassword.message}}
</span>
<span *ngIf="signupForm.get('confirm').hasError('required') && signupForm.get('confirm').dirty">This field is requred</span>
</div>
</div>

'signupForm' is a formGroup.

we can use 'hasError' & 'get()' methods to write the code.

Refer to: Article && Doc

最新文章

  1. JKS和PKCS#12
  2. Springsecurity3.1.3配置多个登陆页面
  3. Java并发编程底层实现原理 - volatile
  4. Xcode7.3更新后插件失效的解决方法
  5. KO+bootstrap 模态窗全选绑定
  6. [HIHO1039]字符消除(字符串,枚举,模拟)
  7. Freemarker例子
  8. adb shell settings ....
  9. Oracle“死锁”模拟
  10. Codeforces Round #324 (Div. 2) B. Kolya and Tanya 快速幂
  11. ASP.NET中扩展FileUpload的上传文件的容量
  12. Android ListView滑动底部自动加载更多
  13. EBS R12安装升级(FRESH)(一)
  14. Zookeeper集群搭建步骤及相关知识点深入了解
  15. unity最基本操作
  16. Coursera Deep Learning 2 Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization - week1, Assignment(Initialization)
  17. kali linux 更新问题
  18. 内存栈与堆的区别C#
  19. 借用HTML5 插入视频。音频
  20. web service初探

热门文章

  1. JS实现下拉菜单的功能
  2. Python的正则表达概述
  3. groupmod---更改群组识别码或名称
  4. 【2017 Multi-University Training Contest - Team 4】Counting Divisors
  5. [AngularFire] Resolve snapshotChanges doesn&#39;t emit value when data is empty
  6. Oracle APEX 4.2公布RESTful Webservice
  7. 漫话C++之string字符串类的使用(有汇编分析)
  8. 李笑来~执行力WWH
  9. MYSQL存储过程中 使用变量 做表名--转
  10. element-UI实现el-table-column百分比自定义分配