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


TypeScript forms.NgForm類代碼示例

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


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

示例1: limpiarFormulario

 limpiarFormulario(form?: NgForm){
   //Si el formulario que le mando existe
   if(form){
     form.reset();
     this.userService.selectedUser= new User();
   }
 }
開發者ID:ItsasoAguirre,項目名稱:BodyAnalyzer,代碼行數:7,代碼來源:users.component.ts

示例2: resetForm

 resetForm(form?: NgForm) {
   if (form != null) {
     form.reset();
     this.teamService.selectedTeam = {
       $key: null,
       title: '',
       description: '',
     };
   }
 }
開發者ID:aracis42,項目名稱:taskrevolver,代碼行數:10,代碼來源:team.component.ts

示例3: addNewComment

 addNewComment(form : NgForm){
   console.log(form);
   this.newComment = {
     stars : form.value.stars,
     author : form.value.author,
     body : form.value.body
   }
   console.log("Comments " + this.newComment);
   this.comments.push(this.newComment);
   form.reset();
 }
開發者ID:ramana2511,項目名稱:myapp4,代碼行數:11,代碼來源:user-comment.component.ts

示例4: resetForm

  resetForm(userForm?: NgForm){
    if(userForm){
      userForm.reset();
      this.userService.selectedUser = {
        $key: null,
        name: '',
        mail: ''
      };
    }

  }
開發者ID:oshingc,項目名稱:AgendaInTheCloud,代碼行數:11,代碼來源:user.component.ts

示例5: resetSchoolForm

 resetSchoolForm(schoolForm?: NgForm) {
   if (this.schoolService.selectedSchool.$key == null) {
     if (schoolForm != null)
       schoolForm.reset();
     this.schoolService.selectedSchool = {
       $key: null,
       name: '',
       EMIS: 0,
       tehsil: '',
       district: '',
       postOffice: ''
     }
     if (this.schoolService.selectedSchool.$key != null)
       alert('edit');
   }
 }
開發者ID:MuhammadTausif,項目名稱:ghs-karounta-quiz,代碼行數:16,代碼來源:add-school.component.ts

示例6: 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

示例7: reply

    /**
     * Reply
     */
    reply(event): void
    {
        event.preventDefault();

        if ( !this._replyForm.form.value.message )
        {
            return;
        }

        // Message
        const message = {
            who    : this.user.id,
            message: this._replyForm.form.value.message,
            time   : new Date().toISOString()
        };

        // Add the message to the chat
        this.chat.dialog.push(message);

        // Reset the reply form
        this._replyForm.reset();

        // Update the server
        this._chatPanelService.updateChat(this.chat.id, this.chat.dialog).then(response => {

            // Prepare the chat for the replies
            this._prepareChatForReplies();
        });
    }
開發者ID:karthik12ui,項目名稱:fuse-angular-full,代碼行數:32,代碼來源:chat-panel.component.ts

示例8: changeForm

 changeForm() {
   this.singUPForm.setValue({
     userInformation: {
       userName: 'John_Doe',
       email: 'john@doe.com',
     },
     password: 'somePass',
     showPassword: 'true'
   });
 }
開發者ID:botirkhuja,項目名稱:hello,代碼行數:10,代碼來源:sing-up.component.ts

示例9: 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

示例10:

 this._taskService.addDish(newDish.value).subscribe(data => {
   if (data['Status'] == true){
     console.log(data['Status'])
     console.log("successfully added", data)
     newDish.reset();
     this.showDish();
   } else {
     console.log(data)
     this.msg = data['Error']
   }
 })
開發者ID:Austin25309w,項目名稱:MEANpro,代碼行數:11,代碼來源:new.component.ts


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