3 ms·
If you really need the ability to pass complex objects via an HTML attribute, you can use the same thing we used in the old jQuery and Knockout days: JSON.parse
by WorldMaker 1y ago
If you really need the ability to pass complex objects via an HTML attribute, you can use the same thing we used in the old jQuery and Knockout days: JSON.parse().
this.someProperty = JSON.parse(this.getAttribute('some-attribute'))