本文整理汇总了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);
}