本文整理匯總了TypeScript中@angular/common.ControlGroup類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ControlGroup類的具體用法?TypeScript ControlGroup怎麽用?TypeScript ControlGroup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ControlGroup類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: setAssetsGroup
function setAssetsGroup(controlGroup: ControlGroup) {
const car = (controlGroup.find('assets').find('cars') as ControlArray).controls[0];
setFieldString(car.find('make'), 'Ford Excursion');
setFieldNumber(car.find('value'), 4);
const alimonyGroup = controlGroup.find('liabilities').find('alimony');
const alimony = (alimonyGroup as ControlArray).controls[0];
setFieldString(alimony.find('description'), 'test');
setFieldNumber(alimony.find('payment'), 4);
}
示例2: passwordsShouldMatch
static passwordsShouldMatch(group: ControlGroup){
var password = group.find('password').value;
var confirmPassword = group.find('confirmPassword').value;
if (password == '' || confirmPassword == '')
return null;
if (password != confirmPassword)
return { passwordsShouldMatch: true };
return null;
}
示例3: passwordMatch
static passwordMatch(group: ControlGroup) {
var newPassword = group.find('new').value;
var confirmPassword = group.find('confirm').value;
if (newPassword == '' || confirmPassword == '')
return null;
if (newPassword != confirmPassword)
return { passwordMatch: true };
return null;
}
示例4: setInfoGroup
function setInfoGroup(controlGroup: ControlGroup) {
setFieldString(controlGroup.find('firstName'));
setFieldString(controlGroup.find('middleName'));
setFieldString(controlGroup.find('lastName'));
setFieldString(controlGroup.find('dob'));
setFieldNumber(controlGroup.find('phone'), 10);
setFieldEmail(controlGroup.find('email'));
setFieldString(controlGroup.find('ssn'));
setFieldAddress(controlGroup.find('address'));
if (controlGroup.contains('maritalStatus')) {
setFieldString(controlGroup.find('maritalStatus'));
}
}
示例5: needToMatch
static needToMatch(changePassForm: ControlGroup) {
var newPass = changePassForm.find('npass').value;
console.log(newPass);
var confPass = changePassForm.find('confirmpass').value;
console.log(confPass);
if (newPass == "" || confPass == "")
return null;
if(confPass != newPass)
return {needToMatch: true};
return null;
}
示例6: passwordMatch
static passwordMatch(group:ControlGroup) {
let password = group.find('password').value;
let repassword = group.find('repassword').value;
if (password === '' || repassword === '') {
return null;
}
if (password !== repassword) {
return {passwordMatch: true};
}
return null;
}
示例7: passwordShouldMatch
static passwordShouldMatch(group: ControlGroup) {
var newPassword = group.find("newpassword").value;
var confirmPassword = group.find("confirmpassword").value;
if (newPassword == '' || confirmPassword == '' ) {
return null;
}
if (newPassword != confirmPassword) {
return { passwordShouldMatch : true }
}
return null;
}
示例8: passwordsShouldMatch
static passwordsShouldMatch(group: ControlGroup){
var newPassword = group.find('newPassword').value;
var confirmPassword = group.find('confirmPassword').value;
// If either of these fields is empty, the validation
// will be bypassed. We expect the required validator to be
// applied first.
if (newPassword == '' || confirmPassword == '')
return null;
if (newPassword != confirmPassword)
return { passwordsShouldMatch: true };
return null;
}
示例9: ngOnInit
ngOnInit() {
this.demoForm = this.formBuilder.group({
'someNumber': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])],
'someNumberStyle': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])],
'someNumberObject': ['', Validators.compose([Validators.required, Validators.minLength(7), this.qaValidators.divisibleByTen])]
});
this.someNumber = this.demoForm.find('someNumber');
this.someNumberStyle = this.demoForm.find('someNumberStyle');
this.someNumberObject = this.demoForm.find('someNumberObject');
}
示例10: signup
signup() {
this.form.find('username').setErrors({
invalidLogin: true
})
console.log(this.form.value);
}