当前位置: 首页>>代码示例>>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;未经允许,请勿转载。