thymeleafjs icon indicating copy to clipboard operation
thymeleafjs copied to clipboard

Storing local variables

Open ultraq opened this issue 8 years ago • 2 comments

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.

ultraq avatar May 06 '17 01:05 ultraq

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...

ultraq avatar Apr 02 '19 03:04 ultraq

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.

ultraq avatar Apr 02 '19 09:04 ultraq