本文整理汇总了TypeScript中@angular/common.ControlGroup.find方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ControlGroup.find方法的具体用法?TypeScript ControlGroup.find怎么用?TypeScript ControlGroup.find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/common.ControlGroup
的用法示例。
在下文中一共展示了ControlGroup.find方法的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: 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');
}
示例3: 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;
}
示例4: 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;
}
示例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: 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;
}
示例8: 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;
}
示例9: signup
signup(){
//var result = authService.login(this.form.value);
this.form.find('username').setErrors({
invalidLogin: true
});
console.log(this.form.value);
}
示例10: signup
signup() {
this.form.find('username').setErrors({
invalidLogin: true
})
console.log(this.form.value);
}