Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

#29: Fixed todos 4 not working #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/blaze/step04.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Event listeners are added to templates in much the same way as helpers are: by c

In our case above, we are listening to the `submit` event on any element that matches the CSS selector `.new-task`. When this event is triggered by the user pressing enter inside the input field, our event handler function is called.

The event handler gets an argument called `event` that has some information about the event that was triggered. In this case `event.target` is our form element, and we can get the value of our input with `event.target.text.value`. You can see all of the other properties of the `event` object by adding a `console.log(event)` and inspecting the object in your browser console.
The event handler gets an argument called `event` that has some information about the event that was triggered. In this case `event.target` is our form element, and we can get the value of our input with `event.target.children.text.value`. You can see all of the other properties of the `event` object by adding a `console.log(event)` and inspecting the object in your browser console.

Finally, in the last line of the event handler, we clear the input to prepare for another new task.

Expand Down
2 changes: 1 addition & 1 deletion generated/blaze.multi.patch
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ index fc36022..42ad1d5 100644
+
+ // Get value from form element
+ const target = event.target;
+ const text = target.text.value;
+ const text = target.children.text.value;
+
+ // Insert a task into the collection
+ Tasks.insert({
Expand Down