Example
The handler receives the template item, so it can read the element and its context. Here it refuses to
render when the checkbox is unticked and otherwise sets the value the element is about to display.
<div b-context="demo.prerender">
<label>
<input type="checkbox" b-bind="show" b-type="boolean" /> render title?
</label>
<h3 b-context="show" b-pre-render="$bindary.controller.preRenderDate">
Today is <b b-value="$parent.date"></b>
</h3>
</div>
$bindary.appData.demo.prerender = { show: true };
ctrl.preRenderDate = () =>
{
let data = $bindary.appData.demo.prerender;
if (!data.show)
return false;
data.date = new Date();
};
Result
Today is
Note the b-context="show" on the heading. Scoping the element to the boolean is what makes it
re-evaluate when the checkbox changes; $parent then reaches back out for the date.