0
내 데이터베이스에 항목을 제출 한 후 내 양식을 지우고 자합니다. 다음은 tutorial입니다.Meteor : Angular2를 사용하여 제출 한 후 양식 지우기
HTML :
<form class="new-task" ng-submit="$ctrl.addTask($crtl.newTask)";>
<input ng-model="$crtl.newTask" type="text" name="text" placeholder="Type to add new tasks" minlength="1"/>
</form>
JS : 이것은 내 코드입니다 그것은 오타, 봤는데해야했다
addTask(newTask) {
// Insert a task into the collection
Tasks.insert({
text: newTask,
createdAt: new Date
});
// Clear form
this.newTask = '';
}