码迷,mamicode.com
首页 > 其他好文 > 详细

[Angular] Reactive Forms Multi-field Custom Validation

时间:2021-03-01 14:05:34      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:make   inf   validator   spl   ror   custom   mic   active   display   

Let‘s say we have a date picker compoent which display start date and end date. We want to make sure that start date is no later than end date, if it was, display an error message.

技术图片

 

Validators:

技术图片

Return null means form is valid. Return object means form has error.

 

Usage:

技术图片

 

技术图片

[Angular] Reactive Forms Multi-field Custom Validation

标签:make   inf   validator   spl   ror   custom   mic   active   display   

原文地址:https://www.cnblogs.com/Answer1215/p/14459780.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!