本文整理汇总了TypeScript中@angular/forms.FormGroup.setValue方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FormGroup.setValue方法的具体用法?TypeScript FormGroup.setValue怎么用?TypeScript FormGroup.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/forms.FormGroup
的用法示例。
在下文中一共展示了FormGroup.setValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: liftItem
liftItem(id: ID) {
const target = this.state.get(TARGET).value;
if( id !== undefined && id !== '' && target === '')
this.state.setValue({ lifted: id, target: '' });
else
this.state.setValue({lifted: '', target: ''});
}
示例2: setValues
/**
* Set/reset the initial values and the referenced category of the update form
*
* @param category
*/
public setValues(category: ViewCategory): void {
this.editId = category.id;
this.updateForm.setValue({
prefix: category.prefix,
name: category.name
});
}
示例3: dropItem
dropItem(targetID: ID) {
const lifted = this.state.get(LIFTED).value;
if (targetID !== undefined && targetID !== '' && lifted !== '')
this.state.get(TARGET).setValue(targetID);
else
this.state.setValue({lifted: '', target: ''});
}
示例4: ngOnInit
ngOnInit() {
this.person = this.route.snapshot.data.person;
const info = this.route.snapshot.data.perUnitRevenueInformation;
if (info) {
this.infoGroup.setValue(info);
}
}
示例5: setValue
// set value of form group
public setValue(): void {
this.registrationForm.setValue({
username: 'niral',
email: 'niralmunjariya@gmail.com',
password: 'abc1234'
});
}
示例6: setDataForm
setDataForm() {
this.formAmbulance.setValue({
car: this.data.car,
car_plate: this.data.car_plate,
type_ambulance: this.data.type_ambulance,
available: this.data.available
});
}
示例7: loadCity
loadCity(data: { longitude: number, latitude: number}): void {
this.form.setValue(data);
this.store.dispatch({
type: SELECT_CITY,
payload: data
});
}
示例8: ngOnChanges
ngOnChanges(){
if (this.usuario === undefined) return;
this.frmUsuario.setValue({
nombre: this.usuario.nombre,
email: this.usuario.email,
carnet: this.usuario.carnet
})
}
示例9: ngOnInit
ngOnInit(): void {
this.getData(this.route.snapshot.paramMap.get('id'));
this.cookieService.set( 'X-XSRF-TOKEN', this.cookieService.get('XSRF-TOKEN') );
this.formGroup.setValue({
'email': this.apartment.email
});
}
示例10:
(ingredientIndex: number) => {
this.editItemIndex = ingredientIndex;
this.editMode = true;
this.editItem = this.shoppingListService.getIngredient(ingredientIndex);
this.addIngredientForm.setValue({
'name': this.editItem.name,
'amount': this.editItem.amount
});
}