jeudi 23 avril 2020

JavaScript Module Pattern and HTML-Element Events

since a few days I working on getting the module pattern (with webpack) in JavaScript an TypeScript right. I know, I'm a little late for the party, but better now than never...

So far, I think I understood most of the best practices and their advantages.

As I'm working on a project that is a few years old, I wonder how the module pattern is used with events-listeners that are written in HTML like: <p onclick="tooltip.open()"></p>

What is the best practice for these situations in combination with the module pattern where I try to prevent polluting the global namespace?

Thanks for the answers in advance.

Aucun commentaire:

Enregistrer un commentaire