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


TypeScript FormGroup.get方法代碼示例

本文整理匯總了TypeScript中@angular/forms.FormGroup.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FormGroup.get方法的具體用法?TypeScript FormGroup.get怎麽用?TypeScript FormGroup.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/forms.FormGroup的用法示例。


在下文中一共展示了FormGroup.get方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: submit

 submit() {
   const body = JSON.stringify({
     newPassword: this.updatePassForm.get('passwords').get('newPassword').value,
     id_user: this.id_user
   });
   this.recoverPasswordService.setPass(body, this.id_user, this.token).subscribe(
     data => {
       // console.log(data);
       if (data.hasOwnProperty('success')) {
         this.snackBar.open(data.msg, data.success ? 'Successfull' : 'Error', {
           duration: 5000,
         });
         if (data.success) {
           this.router.navigate(['']);
         }
       }
     },
     err => console.log(err),
   );
 }
開發者ID:camilolozano,項目名稱:finalAndroid2018-front,代碼行數:20,代碼來源:recover-password.component.ts

示例2: resetPassword

    /**
     * Do the password reset.
     */
    public async resetPassword(): Promise<void> {
        if (this.resetPasswordForm.invalid) {
            return;
        }

        try {
            await this.http.post<void>(environment.urlPrefix + '/users/reset-password/', {
                email: this.resetPasswordForm.get('email').value
            });
            // TODO: Does we get a response for displaying?
            this.matSnackBar.open(
                this.translate.instant('An email with a password reset link was send!'),
                this.translate.instant('OK'),
                {
                    duration: 0
                }
            );
            this.router.navigate(['/login']);
        } catch (e) {
            console.log('error', e);
        }
    }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:25,代碼來源:reset-password.component.ts

示例3: submitNewPassword

    /**
     * Submit the new password.
     */
    public async submitNewPassword(): Promise<void> {
        if (this.newPasswordForm.invalid) {
            return;
        }

        try {
            await this.http.post<void>(environment.urlPrefix + '/users/reset-password-confirm/', {
                user_id: this.user_id,
                token: this.token,
                password: this.newPasswordForm.get('password').value
            });
            // TODO: Does we get a response for displaying?
            this.matSnackBar.open(
                this.translate.instant('Your password was resetted successfully!'),
                this.translate.instant('OK'),
                {
                    duration: 0
                }
            );
            this.router.navigate(['/login']);
        } catch (e) {
            console.log('error', e);
        }
    }
開發者ID:CatoTH,項目名稱:OpenSlides,代碼行數:27,代碼來源:reset-password-confirm.component.ts

示例4: update

 update() {
   const data = {
     paramedic: {},
     error: {},
     valid: false
   };
   if (this.formParamedics.valid) {
     const paramedic = {
       _id: this.data._id,
       name: this.formParamedics.get('name').value,
       lastname: this.formParamedics.get('lastname').value,
       phone: this.formParamedics.get('phone').value,
       cellPhone: this.formParamedics.get('cellPhone').value,
       gender: this.formParamedics.get('gender').value,
       birthdate: this.formParamedics.get('birthdate').value,
       specialization: this.formParamedics.get('specialization').value
     };
     data.paramedic = paramedic;
     data.valid = true;
     this.dialogRef.close(data);
   }else {
     this.errorMessage = 'Los campos marcados con * son obligatorios';
   }
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:24,代碼來源:modal-edit-paramedics.component.ts

示例5: getUserDataFromForm

 getUserDataFromForm() {
   return {
     email: this.loginForm.get('email').value,
     password: this.loginForm.get('password').value
   };
 }
開發者ID:reisub0,項目名稱:mainflux,代碼行數:6,代碼來源:login.component.ts

示例6:

 CdValidators.custom('not-dividable-by-x', (y) => {
   const x = (form && form.get('x').value) || 1;
   return y % x !== 0;
 })
開發者ID:yanghonggang,項目名稱:ceph,代碼行數:4,代碼來源:cd-validators.spec.ts

示例7: it

 it('should accept valid version 4 uuid', () => {
   const x = form.get('x');
   x.setValue('e33bbcb6-fcc3-40b1-ae81-3f81706a35d5');
   expect(x.valid).toBeTruthy();
   expect(x.hasError('pattern')).toBeFalsy();
 });
開發者ID:yanghonggang,項目名稱:ceph,代碼行數:6,代碼來源:cd-validators.spec.ts

示例8: it

      it('should return an element of an array', () => {
        const g = new FormGroup({'array': new FormArray([new FormControl('111')])});

        expect(g.get(['array', 0]).value).toEqual('111');
      });
開發者ID:manekinekko,項目名稱:angular,代碼行數:5,代碼來源:form_array_spec.ts

示例9: password

 get password() {
   return this.loginForm.get("password");
 }
開發者ID:stwel,項目名稱:SoftUni,代碼行數:3,代碼來源:login-form.component.ts


注:本文中的@angular/forms.FormGroup.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。