當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。