当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript common.ControlGroup类代码示例

本文整理汇总了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);
 }
开发者ID:louisscruz,项目名称:freedom-mortgage,代码行数:9,代码来源:apply.spec.ts

示例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;
 }
开发者ID:kevinaud,项目名称:serverless-login,代码行数:12,代码来源:sign-up.validators.ts

示例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;
    }
开发者ID:clintlosee,项目名称:angular2-course,代码行数:12,代码来源:customValidators.ts

示例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'));
   }
 }
开发者ID:louisscruz,项目名称:freedom-mortgage,代码行数:13,代码来源:apply.spec.ts

示例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;
    }
开发者ID:Nordnat,项目名称:angular2udemy,代码行数:13,代码来源:notMatchValidators.ts

示例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;
  }
开发者ID:EmilianoGerez,项目名称:Angular2-JWT-Seed,代码行数:14,代码来源:user.validators.ts

示例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;

    }
开发者ID:RizwanZaheer,项目名称:angular2js,代码行数:15,代码来源:passwordValidators.ts

示例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;
 }
开发者ID:dacho68,项目名称:Angular2-104,代码行数:15,代码来源:passwordValidators.ts

示例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');
  }
开发者ID:AlmeroSteyn,项目名称:Angular2-Playground-Bootstrap,代码行数:11,代码来源:qa-validators-demo.component.ts

示例10: signup

    signup() {
        this.form.find('username').setErrors({
            invalidLogin: true
        })

        console.log(this.form.value);
    }
开发者ID:Nordnat,项目名称:angular2udemy,代码行数:7,代码来源:signup-form.component.ts


注:本文中的@angular/common.ControlGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。