当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript FormGroup.setValue方法代码示例

本文整理汇总了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: ''}); 
 }
开发者ID:yeg-relief,项目名称:screenerClient,代码行数:7,代码来源:drag-drop-manager.service.ts

示例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
     });
 }
开发者ID:emanuelschuetze,项目名称:OpenSlides,代码行数:12,代码来源:category-list.component.ts

示例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: ''}); 
 }
开发者ID:yeg-relief,项目名称:screenerClient,代码行数:7,代码来源:drag-drop-manager.service.ts

示例4: ngOnInit

 ngOnInit() {
   this.person = this.route.snapshot.data.person;
   const info = this.route.snapshot.data.perUnitRevenueInformation;
   if (info) {
     this.infoGroup.setValue(info);
   }
 }
开发者ID:Ninja-Squad,项目名称:globe42,代码行数:7,代码来源:person-per-unit-revenue-information-edit.component.ts

示例5: setValue

 // set value of form group
 public setValue(): void {
   this.registrationForm.setValue({
     username: 'niral',
     email: 'niralmunjariya@gmail.com',
     password: 'abc1234'
   });
 }
开发者ID:niralmunjariya,项目名称:angular-dynamic-forms,代码行数:8,代码来源:registration.component.ts

示例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
   });
 }
开发者ID:manuelao-s4ds,项目名称:Emergencies-ui,代码行数:8,代码来源:modal-edit-ambulances.component.ts

示例7: loadCity

  loadCity(data: { longitude: number, latitude: number}): void {
    this.form.setValue(data);

    this.store.dispatch({
      type: SELECT_CITY,
      payload: data
    });
  }
开发者ID:akazimirov,项目名称:domic,代码行数:8,代码来源:weather.component.ts

示例8: ngOnChanges

 ngOnChanges(){
   if (this.usuario === undefined) return;
   this.frmUsuario.setValue({
     nombre: this.usuario.nombre,
     email: this.usuario.email,
     carnet: this.usuario.carnet
   })
 }
开发者ID:UnopposedQuill,项目名称:II-Progra-Bases-Datos,代码行数:8,代码来源:usuario-contenido.component.ts

示例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
    });
  }
开发者ID:nsarvar,项目名称:animus-frontend,代码行数:8,代码来源:apartment-modify.component.ts

示例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
   });
 }
开发者ID:AlucardxTepes,项目名称:AngularRecipes,代码行数:9,代码来源:shopping-edit.component.ts


注:本文中的@angular/forms.FormGroup.setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。