0.0.3 • Published 6 years ago

ngx-validator-extend v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

github;

安装

npm i ngx-validator-extend --save

使用

这是一个服务,注入后就可以使用

...
 constructor(
    private validExd: NgxValidatorExtendService,
  ) { }
  ...
let sub = this.fb.group({
    site: [''test, [this.validExd.required(),this.validExd.selfDefine(function (ctr: AbstractControl,opt:any) {
        console.log(opt);
        return ctr.value === 'yourDefined' ? null : {
            'yourDefined': true
        }
      },{a:1})],
})