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


TypeScript FormGroup.reset方法代碼示例

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


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

示例1: cacel

 cacel() {
   this.formEmergency.reset({
     driver: '',
     paramedic: '',
     ambulance: ''
   });
   this.formPatient.reset();
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:8,代碼來源:emergency.component.ts

示例2: if

 }).subscribe((d) => {
   if(d == 1) {
     this._fM.show('<h5>Thank you for your subscription.!</h5><p>This newsletter is generally sent out a weekly basis.</p>', { cssClass: 'alert-success', timeout: 6000 });
     this.newsLetterForm.reset();
   } else if(d == 2) {
     this._fM.show('Your are already subscribe!', { cssClass: 'alert-info', timeout: 3000 });
     this.newsLetterForm.reset();
   }
   if(d == 0) {
     this._fM.show('Error please try again!', { cssClass: 'alert-danger', timeout: 3000 });
   }
 });
開發者ID:viveksh09876,項目名稱:fruitastic,代碼行數:12,代碼來源:footer.component.ts

示例3: saveEmergency

 saveEmergency() {
   if (this.formEmergency.valid) {
     if (this.patients.length > 0) {
       const emergency = {
         date: this.formEmergency.get('date').value,
         type_emergency: this.formEmergency.get('category').value,
         driver: this.driverSelected,
         ambulance: this.ambulanceSelected,
         paramedic: this.paramedicsSelected,
         patient: this.patients,
         location: {
           type: 'Point',
           coordinates: this.positions
         }
       };
       this.formEmergency.reset({
         driver: '',
         ambulance: '',
         paramedics: ''
       });
       this._emergencyService.save(emergency).subscribe(
         (res) => {
           console.log(res.json());
         },
         (error) => {
           console.log(error.json());
         }
       );
     }else{
       this._toast.info('Debe ingresar al menos un paciente', 'Emergencias!');
     }
   }else{
     this._toast.info('Todos los campos marcados con * son obligatorios', 'Emergencias!');
   }
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:35,代碼來源:emergency.component.ts

示例4: resetForm

 resetForm() {
   this.blogForm.reset({
     title: '',
     urlTitle: '',
     contents: ''
   });
 }
開發者ID:maartenl,項目名稱:Land-of-Karchan,代碼行數:7,代碼來源:blogs.component.ts

示例5: saveAmbulance

 saveAmbulance() {
   if (this.formAmbulance.valid) {
     const ambulance = {
       car: this.formAmbulance.get('car').value,
       car_plate: this.formAmbulance.get('car_plate').value,
       type_ambulance: this.formAmbulance.get('type_ambulance').value,
       available: this.formAmbulance.get('available').value
     };
     this.formAmbulance.reset({
       car: '',
       car_plate: '',
       type_ambulance: '',
       available: ''
     });
     this._ambulanceService.save(ambulance).subscribe(
       (res) => {
         console.log(res.json());
       },
       (error) => {
         console.log(error.json());
       }
     );
   }else {
     this._toast.info('Todos los campos marcados con * son obligatorios', 'Ambulancias!');
   }
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:26,代碼來源:ambulances.component.ts

示例6: resetForm

 resetForm() {
   this.templateForm.reset({
     name: '',
     content: '',
     comment: ''
   });
 }
開發者ID:maartenl,項目名稱:Land-of-Karchan,代碼行數:7,代碼來源:templates.component.ts

示例7: onConfirmLink

 private onConfirmLink(){
     // Ensure that the form is valid
     if (this.uploadLinkForm.valid){
         // Obtain the link from the form
         let link = this.uploadLinkForm.controls['link'].value;
         let origin = 'youtube-play';
         // Set the origin to vimeo if the url is a vimeo link
         if (link.includes('vimeo')){
             origin = 'vimeo';
         }
         // Or to soundcloud if it's from soundcloud
         if (link.includes('soundcloud')){
             origin = 'soundcloud';
         }
         // Populate pending uploads data list with link and origin
         this.pendingUploadsDataSet.push({
             'id': UUID.UUID(),
             'link': link,
             'origin': origin,
             'isNameValid': true,
             'isUploading': false
         });
         // Clear the video upload link forum
         this.uploadLinkForm.reset();
     }
 }
開發者ID:skoocda,項目名稱:spreza,代碼行數:26,代碼來源:profile.ts

示例8: update

 update() {
   const data = {
     emergency: {},
     error: {},
     valid: false
   };
   if (this.formEmergency.valid) {
     const emergency = {
       _id: this.data._id,
       date: this.formEmergency.get('date').value,
       type_emergency: this.formEmergency.get('category').value,
       driver: this.driverSelected,
       ambulance: this.ambulanceSelected,
       paramedic: this.paramedicsSelected,
       patient: this.patients,
       location: this.data.location
     };
     this.formEmergency.reset({
       driver: '',
       ambulance: '',
       paramedics: ''
     });
     data.emergency = emergency;
     data.valid = true;
     this.dialogRef.close(data);
   }else {
     this.errorMessage = 'Los campos marcados con * son obligatorios';
   }
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:29,代碼來源:modal-edit-emergencies.component.ts

示例9: update

 update() {
   const data = {
     ambulance: {},
     error: {},
     valid: false
   };
   debugger
   if (this.formAmbulance.valid) {
     const ambulance = {
       _id: this.data._id, 
       car: this.formAmbulance.get('car').value,
       car_plate: this.formAmbulance.get('car_plate').value,
       type_ambulance: this.formAmbulance.get('type_ambulance').value,
       available: this.formAmbulance.get('available').value
     };
     this.formAmbulance.reset({
       car: '',
       car_plate: '',
       type_ambulance: '',
       available: ''
     });
     data.ambulance = ambulance;
     data.valid = true;
     this.dialogRef.close(data);
   }else {
     this.errorMessage = 'Los campos marcados con * son obligatorios';
   }
 }
開發者ID:manuelao-s4ds,項目名稱:Emergencies-ui,代碼行數:28,代碼來源:modal-edit-ambulances.component.ts

示例10: handlePostResponse

 protected handlePostResponse(res: Response) {
   console.log('**** response from password POST ***');
   console.log(JSON.stringify(res));
   console.log('***************************************');
   this.formGroup.reset();
   this.accountSvc.doGetRequest("/credentials/password", (res: Response) => this.handleGetResponse(res));
 }
開發者ID:cargosoft,項目名稱:keycloak,代碼行數:7,代碼來源:password-page.component.ts


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