Similar to the toggle
handler, but it will detach the element from the DOM instead of just hiding it. Much like knockout's if
binding.
Usage
<div data-bind="if: someCondition"></div>
where someCondition
can of course also be a computed property, so this gives you all flexibility you need.
Why not use just toggle
? Because selectors like :first
etc. won't work.
Just found that it doesn't work on initial rendering since it happens before Epoxy adds the element to the DOM. I'll see what I can do. I was using it to hide elements in a list as the user searches, where this case naturally didn't occur.