当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript NgForm.reset方法代码示例

本文整理汇总了TypeScript中@angular/forms.NgForm.reset方法的典型用法代码示例。如果您正苦于以下问题:TypeScript NgForm.reset方法的具体用法?TypeScript NgForm.reset怎么用?TypeScript NgForm.reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@angular/forms.NgForm的用法示例。


在下文中一共展示了NgForm.reset方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

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

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

示例3: resetForm

 resetForm(form?: NgForm) {
   if (form != null) {
     form.reset();
     this.teamService.selectedTeam = {
       $key: null,
       title: '',
       description: '',
     };
   }
 }
开发者ID:aracis42,项目名称:taskrevolver,代码行数:10,代码来源:team.component.ts

示例4:

 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

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

示例6: resetForm

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

  }
开发者ID:oshingc,项目名称:AgendaInTheCloud,代码行数:11,代码来源:user.component.ts

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

示例8:

            .then(() => {
                if (this.firstNameInput && this.firstNameInput.dirty) {
                    this.user.firstName = this.details.firstName
                }
                if (this.lastNameInput && this.lastNameInput.dirty) {
                    this.user.lastName = this.details.lastName
                }
                this.updateInStructures()
                this.userListService.updateSubject.next();

                this.administrativeForm.reset(this.details && this.details.toJSON())

                this.ns.success(
                    { 
                        key: 'notify.user.update.content', 
                        parameters: {
                            user: this.details.firstName + ' ' + this.user.lastName 
                        } 
                    }, 'notify.user.update.title')

                this.userInfoService.setState(this.details);
            })
开发者ID:entcore,项目名称:entcore,代码行数:22,代码来源:user-administrative-section.component.ts

示例9: onCategoryAdd

 onCategoryAdd() {
   this.addCategoryForm.reset();
   this.error = null;
 }
开发者ID:Dejaaaan,项目名称:library,代码行数:4,代码来源:categories.component.ts

示例10: onAddItem

 onAddItem(form: NgForm) {
   this.slService.addItem(form.value.ingredienName, form.value.amount);
   form.reset();
   this.loadItems();
 }
开发者ID:soya196,项目名称:myng,代码行数:5,代码来源:shopping-list.ts


注:本文中的@angular/forms.NgForm.reset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。