本文整理汇总了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();
});
}
示例2: limpiarFormulario
limpiarFormulario(form?: NgForm){
//Si el formulario que le mando existe
if(form){
form.reset();
this.userService.selectedUser= new User();
}
}
示例3: resetForm
resetForm(form?: NgForm) {
if (form != null) {
form.reset();
this.teamService.selectedTeam = {
$key: null,
title: '',
description: '',
};
}
}
示例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']
}
})
示例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();
}
示例6: resetForm
resetForm(userForm?: NgForm){
if(userForm){
userForm.reset();
this.userService.selectedUser = {
$key: null,
name: '',
mail: ''
};
}
}
示例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');
}
}
示例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);
})
示例9: onCategoryAdd
onCategoryAdd() {
this.addCategoryForm.reset();
this.error = null;
}
示例10: onAddItem
onAddItem(form: NgForm) {
this.slService.addItem(form.value.ingredienName, form.value.amount);
form.reset();
this.loadItems();
}