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


TypeScript NgForm.resetForm方法代碼示例

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


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

示例1: hideDialog

  hideDialog() {
   this.dialogDisplayed = false;
   if (this.editing) {
     this.refreshOnEdit(this.contact, this.selectedContact) // Refresh dataTable after company update
   }
   this.contactForm.resetForm();
 }
開發者ID:edouardo,項目名稱:schedule-sys,代碼行數:7,代碼來源:contact.component.ts

示例2: navigateToSelectedIndex

    private navigateToSelectedIndex() {
        const optionalParams = {
            index: this.state.getIndex()
        };

        this.stopRestTimer();
        this.alarm.pause();
        this.workoutForm.resetForm();
        this.router.navigate(['workouts', this.workout.workoutId, optionalParams]);
    }
開發者ID:jbload,項目名稱:Muscularity,代碼行數:10,代碼來源:workout.component.ts

示例3: onSubmit

 onSubmit(form: NgForm) {
     // Create
     var image = form.value.image;
     if(image == null  || image.length < 20 || image.includes('instagram') || !(image.includes("http") && image.includes("com")) ){
         form.value.image = "https://i1.wp.com/eddieandsylviarobertson.com/wp-content/uploads/2015/09/Default-Icon-icon.png";
     }
     if(form.value.author == null){
         form.value.author = "睡前要吃飽,否則會做餓夢的";
     }
     this.messageService.addMessage(new Message(
                                     form.value.content, 
                                     form.value.author,
                                     form.value.image,
                                     (new Date()).toLocaleString() ))
         .subscribe(
             data => console.log(data),
             error => console.error(error)
         );
     form.resetForm();
 }
開發者ID:shaowenstudio,項目名稱:ResumeProjects,代碼行數:20,代碼來源:message-input.component.ts

示例4: onSubmit

 onSubmit(form: NgForm) {
     if(this.message) {
         //Edit
         this.message.content = form.value.content;
         this.messageService.updateMessage(this.message)
             .subscribe(
                 result => console.log(result)  
             );
         this.message = null;
     }else{
     //console.log(form);
     //console.log(value);
     const message = new Message(form.value.content, 'Srivatsa');
     this.messageService.addMessage(message)
         .subscribe(
             data => console.log(data),
             error => console.log(error)
         );
     }
     form.resetForm();
 }
開發者ID:Srivatsa2393,項目名稱:MEAN-Stack-Guide,代碼行數:21,代碼來源:message-input.component.ts

示例5: onSubmit

 // Incoming value of type String
 onSubmit(form: NgForm) {
   if (this.message) {
     // Edit
     this.message.content = form.value.content;
     this.messageService.updateMessage(this.message)
                        .subscribe(
                          result => console.log(result)
                        );
     this.message = null;
   } else {
     // Creating
     const message = new Message(form.value.content, "John");
     this.messageService.addMessage(message)
         // Send the request
         .subscribe(
           data => console.log(data),
           error => console.error(error)
         );
   }
   // Angular's method
   form.resetForm();
 }
開發者ID:freesk,項目名稱:angular2-messenger,代碼行數:23,代碼來源:message-input.component.ts

示例6: onClear

 onClear(form: NgForm) {
   // Clear
   this.message = null;
   form.resetForm();
 }
開發者ID:freesk,項目名稱:angular2-messenger,代碼行數:5,代碼來源:message-input.component.ts

示例7: setTimeout

 setTimeout(() => {
     this.form.resetForm();
 },100);
開發者ID:mm999,項目名稱:cas,代碼行數:3,代碼來源:contacts.component.ts


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