10+years of international development cooperation, now full with project ideas but mediocre skills to turn them into reality...
Main interests: ++ ag-tech ++ stem ++ gardening ++
You'll notice that JS throws a TypeError which must have something to do with the scope, I presume. I've usually found workarounds, but I do not like them. I'd like to really understand the problem.
Hi Brit,
sorry for the late response - I couldn't exactly remember where it happened, but now I found the problem:
Assume the following micro-example:
Here's a possible corresponding html-file:
You'll notice that JS throws a TypeError which must have something to do with the scope, I presume. I've usually found workarounds, but I do not like them. I'd like to really understand the problem.
Thanks!
Sebastian.
This is likely a scope issue. A couple of things to know about classes:
In your case point 1 is the issue - classes are not hoisted. You've created Handler below where you are invoking it.
Here's a codepen where I explain classes a little deeper. Hopefully that's helpful :)
codepen.io/BritHemming/pen/WNvYJMr