本文整理汇总了TypeScript中angular2/common.Control.updateValue方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Control.updateValue方法的具体用法?TypeScript Control.updateValue怎么用?TypeScript Control.updateValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类angular2/common.Control
的用法示例。
在下文中一共展示了Control.updateValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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('');
});
示例2: 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;
}
if(!this.field.isTypeFile()) {
this.fieldControl.updateValue(value);
}
}, 0);
示例3:
.subscribe(movie =>{
this.id.updateValue(movie.id);
this.title.updateValue(movie.title);
this.rating.updateValue(movie.rating);
this.length.updateValue(movie.length)
});
示例4:
this.friendStore.addFriend(this.form.value).subscribe( createdFriend => {
this.firstname.updateValue('');
this.lastname.updateValue('');
})