Created
May 30, 2020 23:37
-
-
Save StalinMazaEpn/de0c368a48e1300c81c0581024b979b1 to your computer and use it in GitHub Desktop.
Checkbox Validator Angular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FormControl } from '@angular/forms'; | |
export class CheckboxValidator{ | |
static isChecked(control: FormControl) : any{ | |
if(control.value != true){ | |
return { | |
"notChecked" : true | |
}; | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment