data-element marks an element as optional. It will be removed from the document if nothing is bound to it.
Docs: https://github.com/phpgt/DomTemplate/wiki/Conditional-and-optional-elements#data-element
I've just been adding the pagination of www.php.gt and I wanted to have a previous/next link. <a href="?page={{prevPage}} data-element>Previous page`
The data-element should remove the link if there is no previous page, but I had to add another data-bind parameter on it to trigger this functionality. <a href="?page={{prevPage}} data-element data-bind:data-prev="prevPage">Previous page`.
If something is bound via the curly braces, it should trigger the data-element functionality, just like it does already with data-bind attributes.
data-elementmarks an element as optional. It will be removed from the document if nothing is bound to it.Docs: https://github.com/phpgt/DomTemplate/wiki/Conditional-and-optional-elements#data-element
I've just been adding the pagination of www.php.gt and I wanted to have a previous/next link.
<a href="?page={{prevPage}}data-element>Previous page`The
data-elementshould remove the link if there is no previous page, but I had to add another data-bind parameter on it to trigger this functionality.<a href="?page={{prevPage}}data-element data-bind:data-prev="prevPage">Previous page`.If something is bound via the curly braces, it should trigger the data-element functionality, just like it does already with data-bind attributes.