ui
ui copied to clipboard
Some templates are missing common properties like id
Templates like admin.html/pug
are missing id
property.
Is that intentional?
Element properties like id
, data
, ... has almost nothing to do with styling and if user/programmer wants to add them, it should be always possible no matter if defined in the template or not.
This is a feature request to introduce some special template parameter like {$implicit_props}
which can be easily added to all templates and then the common html properties can be added with one centralized code from View
. Another option might be to always parse the template and set the common properties by DOM (which is not easy, as templates might not be always be valid html).
Some of those properties were added on “need to” basis.
Also it's possible that some templates do not need these id because they are not used there or template is part of another template.
@DarkSide666 I spotted this when I needed to work with main layout - there is no id and also jQuery
without custom selector did not worked, as the id does not exist and can not be currently added.
Quite legit use case.
Yes sure. I'm not against it. We should add {$_id}
in all of them.
templates should be redesigned to be parsed into DOM - we can then manupulate the DOM in init as needed then