当前位置: 首页>>代码示例>>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;未经允许,请勿转载。