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


TypeScript Control.updateValue方法代碼示例

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


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

示例1: showAllData

 /**
  * Sets the filters for year from and year to such that all data is shown.
  */
 showAllData() {
   if (!this.years)
     return;
   
   this.yearFrom.updateValue(this.years[0]);
   this.yearTo.updateValue(this.years[this.years.length-1]);
 }
開發者ID:thorstenschaefer,項目名稱:d3-playground,代碼行數:10,代碼來源:gdp.component.ts

示例2: send

    /**
     * Form submit handler.
     * Send a Message to the Room with id.
     */
    send() {
        if (this.message.valid) {
            // Send message to server
            this._roomService.sendMessage(parseInt(this._routeParams.get('id')), this.messageForm.value.message);

            // Reset the form
            this.message.updateValue('');
        }
    }
開發者ID:riblee,項目名稱:chat-client,代碼行數:13,代碼來源:roomDetail.component.ts

示例3: it

 it('resets a control', () => {
   let control: Control = new Control('');
   let returnedControl: AbstractControl = null;
   control.markAsTouched();
   control.updateValue('dave');
   returnedControl = Utils.resetControl(control);
   expect(returnedControl.touched).toBe(false);
   expect(returnedControl.untouched).toBe(true);
   expect(returnedControl.pristine).toBe(true);
   expect(returnedControl.dirty).toBe(false);
   expect(returnedControl.value).toBe('');
 });
開發者ID:tja4472,項目名稱:ngrx-clicker-ionic,代碼行數:12,代碼來源:utils.spec.ts

示例4: setTimeout

        setTimeout(()=> {
            this.formDir.form.addControl(this.field.name,this.fieldControl);

            let value:any = '';
            if(this.entity && this.entity.extraFields && this.entity.extraFields[this.field.name]) {
                value = this.entity.extraFields[this.field.name];
            }  else if(this.field.hasValue()) {
                value = this.field.value;
                this.entity.extraFields[this.field.name] = value;
                console.log(this.entity);
            }
            if(!this.field.isTypeFile()) {
                this.fieldControl.updateValue(value);
            }
        }, 0);
開發者ID:billirg,項目名稱:angular-spring-dynamic-form,代碼行數:15,代碼來源:extra-field.ts

示例5:

            .catch(error => {
                this.password.updateValue("");

                if (error.code === "auth/invalid-email" || error.code === "auth/wrong-password") {
                    this.showLoginFailure("Email or password invalid");
                    return;
                }
                if (error.code === "auth/user-disabled") {
                    this.showLoginFailure("User has been disabled");
                    return;
                }
                if (error.code === "auth/user-not-found") {
                    this.showLoginFailure("User not found");
                    return;
                }
            });
開發者ID:isman-usoh,項目名稱:followork,代碼行數:16,代碼來源:login.ts

示例6: it

        it('should check is value is a valid email', () => {


            let control = new Control('test@test.nl');

            let result: ValidationResult = FormValidators.isMailAddress(control);

            expect(result).toBeDefined();
            expect(result['mail_format_error']).toBe(false);

            // set value to alphanumeric
            control.updateValue('abc');

            result = FormValidators.isMailAddress(control);
            expect(result['mail_format_error']).toBe(true);
        });
開發者ID:haiko,項目名稱:ng2-form-utils,代碼行數:16,代碼來源:form.validators.spec.ts

示例7:

            .catch(error => {
                this.password.updateValue("");

                if (error.code === "auth/email-already-in-use") {
                    this.showLoginFailure("Email already exists an account");
                    return;
                }
                if (error.code === "auth/invalid-email") {
                    this.showLoginFailure("Email address is not valid");
                    return;
                }
                if (error.code === "auth/operation-not-allowed") {
                    this.showLoginFailure("Email/password accounts are not enabled");
                    return;
                }
                if (error.code === "auth/weak-password") {
                    this.showLoginFailure("Password is not strong enough");
                    return;
                }
            });
開發者ID:isman-usoh,項目名稱:followork,代碼行數:20,代碼來源:register.ts

示例8:

 res => {
     this.ctrlRegPasswordConfirm.updateValue("");
     this.login();
     this.turnOffError();
 },
開發者ID:mducnguyen,項目名稱:TicklrClient,代碼行數:5,代碼來源:auth.component.ts


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