ngx-validator-extend

0.0.3 • Public • Published

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})],
})

Readme

Keywords

Package Sidebar

Install

npm i ngx-validator-extend

Weekly Downloads

1

Version

0.0.3

License

ISC

Last publish

Collaborators

  • gary_h