From 8f0f4e06aaf3d86867c610ec777101d24141e265 Mon Sep 17 00:00:00 2001 From: mahdiyeh1 Date: Mon, 26 Mar 2018 19:44:14 +0200 Subject: [PATCH] #29: Fixed todos 4 not working Simple Todos 4 - event.target.x.value should be changed to: event.target.children.x.value --- content/blaze/step04.md | 2 +- generated/blaze.multi.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/blaze/step04.md b/content/blaze/step04.md index dc7a291..1d2383b 100644 --- a/content/blaze/step04.md +++ b/content/blaze/step04.md @@ -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. diff --git a/generated/blaze.multi.patch b/generated/blaze.multi.patch index f0f3b17..1809f86 100644 --- a/generated/blaze.multi.patch +++ b/generated/blaze.multi.patch @@ -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({