thymeleafjs
thymeleafjs copied to clipboard
Storing local variables
In Thymeleaf, the DOM elements were some custom built ones so it was able to have additional properties like node local variables. In this project, I'm using the standard DOM elements and have currently resorted to putting local variables on those elements as the data attribute data-thymeleaf-local-variables. This works, but is quite implementation leaky!
So, come up with another way to store local variables associated with an element.
Really need this one now. Found a case where I was passing a date object around and Dates don't serialize/deserialize very well! That virtual DOM idea (#28) is sounding more enticing...
Now sitting on a __thymeleafLocalVariables property of an element. If I'm to keep it out of the DOM then something like a Map might be needed as the key can be anything, in this case a DOM element.