本文整理汇总了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: '[email protected]',
},
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;未经允许,请勿转载。 |
请发表评论