refactor(forms): extract Validators.required into a variable as transformers cannot resolve statics
This commit is contained in:
parent
0dbf959548
commit
d23b973e7a
|
@ -26,8 +26,10 @@ import {NumberWrapper} from "angular2/src/facade/lang";
|
|||
*/
|
||||
export interface Validator { validate(c: modelModule.AbstractControl): {[key: string]: any}; }
|
||||
|
||||
const REQUIRED = Validators.required;
|
||||
|
||||
const REQUIRED_VALIDATOR =
|
||||
CONST_EXPR(new Provider(NG_VALIDATORS, {useValue: Validators.required, multi: true}));
|
||||
CONST_EXPR(new Provider(NG_VALIDATORS, {useValue: REQUIRED, multi: true}));
|
||||
|
||||
/**
|
||||
* A Directive that adds the `required` validator to any controls marked with the
|
||||
|
|
Loading…
Reference in New Issue