license import { Directive , forwardRef , Provider , } from '@angular/core' ; import { CheckboxRequiredValidator , NG_VALIDATORS , } from '@angular/forms' ; export const MAT_CHECKBOX_REQUIRED_VALIDATOR = { provide : NG_VALIDATORS , useExisting : forwardRef ( ( ) => MatCheckboxRequiredValidator ) , multi : true } ; /**
 * Validator for Material checkbox's required attribute in template-driven checkbox.
 * Current CheckboxRequiredValidator only work with `input type=checkbox` and does not
 * work with `mat-checkbox`.
 */ @ Directive ( { selector : `mat-checkbox[required][formControlName],
             mat-checkbox[required][formControl], mat-checkbox[required][ngModel]` , providers : [ MAT_CHECKBOX_REQUIRED_VALIDATOR ] , host : { '[attr.required]' : 'required ? "" : null' } } ) export class MatCheckboxRequiredValidator extends CheckboxRequiredValidator { }