Quantcast
Viewing all articles
Browse latest Browse all 3491

Re : Live Binding Question

Ok, so you have to remove a DOM element that is an ancestor to live binding in a template in order or it to clean up its bindings. It also seems that the live binding in a template must be wrapped in an element too. This will not get torn down if an ancestor element is removed.
  1. <script id="dummyEJS" type="text/ejs">
        <%= player.attr("name") %>
    </script>
It needs to be:
  1. <script id="dummyEJS" type="text/ejs">
        <div><%= player.attr("name") %></div>
    </script>
Is there a best practices for making sure that all template generated bindings to an observe are torn down and removed when the control that generated them is destroyed?

I have a mainContent div that I create can.Controls on and when it's time to remove that control, I empty the mainContent div which triggers the control's destroy. But now it seems that this won't clean up template generated bindings. 





Viewing all articles
Browse latest Browse all 3491

Trending Articles