This is regression from early Transparency versions.
html() directive should allow to take element node as input value for manipulation, so that user can run his/her custom crap over the element instead of generating HTML as text or DOM nodes.
Example use case:
// Template directives
var directives = {
// Conditionally set CSS state to empty or not
// whether we have any products in the list
'checkout-list-root' : {
html : function(elem) {
var $elem = $(elem);
// Set a CSS class which will determine
// whether we so "no items" or list view
if(data.count > 0) {
$elem.addClass("has-items");
} else {
$elem.removeClass("has-items");
}
}
},
(Though this is bad example as this could be now done with attribute API?)
Possible API implementations
If HTML directive returns null or undefined, then assume it did in-place manipulation and call to setHtml can be ignored [recommended]
Have another directive name for inplace manipulations (e.g. directives : { mutate(elem) })
If you provide green light for this after discussion I can provide patch
This is regression from early Transparency versions.
html() directive should allow to take element node as input value for manipulation, so that user can run his/her custom crap over the element instead of generating HTML as text or DOM nodes.
Example use case:
(Though this is bad example as this could be now done with attribute API?)
Possible API implementations
If you provide green light for this after discussion I can provide patch