本文整理汇总了TypeScript中angular2/common.Validators.compose方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Validators.compose方法的具体用法?TypeScript Validators.compose怎么用?TypeScript Validators.compose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/common.Validators
的用法示例。
在下文中一共展示了Validators.compose方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(public nav: NavController, fb: FormBuilder) {
this.nav = nav;
this.memberForm = fb.group({
fullname: ["",Validators.required],
username: ["",Validators.required],
//password: ["",Validators.required]
password: ["",Validators.compose([Validators.required,Validators.minLength(8)])] // required password 8 charactor
});
}
示例2: constructor
constructor(fb: FormBuilder, public addressService: Addresses, private router: Router) {
this.editAddressForm = fb.group({
'mail': ['', Validators.compose([
Validators.required, mailValidator])],
'firstName': ['', Validators.required],
'lastName': ['', Validators.required],
'country': ['', Validators.required]
});
}
示例3: constructor
constructor(fb:FormBuilder) {
this.form = fb.group({
username: ['', Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace
]), UsernameValidators.shouldBeUnique], // shouldBeUnique is an async validator
password: ['', Validators.required]
});
}
示例4: constructor
constructor(signupform: FormBuilder, private _http: Http, private httpservice: HttpService, private _router: Router) {
this.SignupForm = signupform.group({
"username": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
"firstname": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
"lastname": ["", Validators.compose([Validators.required, CustomFromValidation.isStartWithNumber])],
"email": ["", Validators.compose([Validators.required, CustomFromValidation.EmailValidation])],
"password": ["", Validators.compose([Validators.required, Validators.minLength(3)])],
"confirmPassword": ["", Validators.required]
});
this.username = this.SignupForm.controls["username"];
this.firstname = this.SignupForm.controls["firstname"];
this.lastname = this.SignupForm.controls["lastname"];
this.email = this.SignupForm.controls["email"];
this.password = this.SignupForm.controls["password"];
this.confirmPassword = this.SignupForm.controls["confirmPassword"];
}
示例5: constructor
constructor(fb: FormBuilder){
this.form = fb.group({
username: ['',Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace
])],
password: ['',Validators.required]
})
}
示例6: constructor
constructor(fb: FormBuilder){
this.form = fb.group({
username:['',Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace
]), UsernameValidators.shouldBeUnique], //this array can take 3 params: default value, 1 or more custom synchronous validators, 1 or more async validators
password:['',Validators.required]
})
}
示例7: ngOnInit
ngOnInit(){
this.myForm = this._fb.group({
email: ['',Validators.compose([
Validators.required,
this.isEmail
])],
password: ['',Validators.required]
});
}
示例8: constructor
constructor(fb:FormBuilder,private _router:Router){
this.form = fb.group({
username:['',Validators.compose([
Validators.required,
UsernameValidators.cannotContainSpace]
),UsernameValidators.shoudBeUnique],
password:['',Validators.required]
})
}
示例9: constructor
constructor(app: IonicApp, nav: NavController, dbService: DBService, fb: FormBuilder, userService: UserService) {
this.dbService = dbService;
this.userService = userService;
this.app = app;
this.nav = nav;
this.form = fb.group({
matchingPassword: fb.group({
password: ['', Validators.required],
passwordConfirm: ['', Validators.required]
}, { validator: this.areEqual }),
email: new Control('', Validators.compose([Validators.required, this.isEmail])),
firstName: new Control('', Validators.required),
lastName: new Control('', Validators.required),
mobile: new Control('', Validators.compose([Validators.required, this.isPhoneNumber]))
});
this.signupData = {};
}
示例10: constructor
constructor(fb: FormBuilder) {
this.skuForm = fb.group({
'sku': ['',
Validators.compose([
Validators.required,
skuValidator
])]
});
}