當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ControlGroup.find方法代碼示例

本文整理匯總了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);
 }
開發者ID:louisscruz,項目名稱:freedom-mortgage,代碼行數:9,代碼來源:apply.spec.ts

示例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');
  }
開發者ID:AlmeroSteyn,項目名稱:Angular2-Playground-Bootstrap,代碼行數:11,代碼來源:qa-validators-demo.component.ts

示例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;
 }
開發者ID:kevinaud,項目名稱:serverless-login,代碼行數:12,代碼來源:sign-up.validators.ts

示例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;
    }
開發者ID:clintlosee,項目名稱:angular2-course,代碼行數:12,代碼來源:customValidators.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: 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

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

    }
開發者ID:RizwanZaheer,項目名稱:angular2js,代碼行數:15,代碼來源:passwordValidators.ts

示例9: signup

 signup(){
     //var result = authService.login(this.form.value);
     this.form.find('username').setErrors({
         invalidLogin: true
     });
     console.log(this.form.value);
 }
開發者ID:dacho68,項目名稱:Angular2-104,代碼行數:7,代碼來源:signup-form.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.find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。