What exactly does the data-renderif
attribute do with Batman.js?
I initially thought that it would render the DOM node only if the attribute value would be true. But then there's data-insertif
that does that as expected.
What exactly does the data-renderif
attribute do with Batman.js?
I initially thought that it would render the DOM node only if the attribute value would be true. But then there's data-insertif
that does that as expected.
data-renderif
is only meant to defer evaluating the bindings of a node's children until the binding value is updated to true. You probably want to use it in conjunction withdata-insertif
ordata-removeif
.The
dataChange
method for this binding can be viewed here. This function basically just removes thedata-renderif
attribute and initializes the children node's bindings.