From 5b97637d3cd921c9e043841e906590d70a322c63 Mon Sep 17 00:00:00 2001 From: Lukong Isaac Date: Tue, 14 Sep 2021 13:28:46 +0100 Subject: [PATCH] Bug fix to pass event object into the onLinkClick function when used in the index.html page --- 7-bank-project/1-template-route/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/7-bank-project/1-template-route/README.md b/7-bank-project/1-template-route/README.md index 6107d84a..ac413312 100644 --- a/7-bank-project/1-template-route/README.md +++ b/7-bank-project/1-template-route/README.md @@ -247,11 +247,13 @@ function onLinkClick(event) { Let's complete the navigation system by adding bindings to our *Login* and *Logout* links in the HTML. ```html -Login +Login ... -Logout +Logout ``` +The `event` object above, captures the `click` event and passes it to our `onLinkClick` function. + Using the [`onclick`](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onclick) attribute bind the `click` event to JavaScript code, here the call to the `navigate()` function. Try clicking on these links, you should be now able to navigate between the different screens of your app.