OK, this is pretty helpful, and should give me a solution for my two utility functions.
But, from this I gather that whenever I remove elements from the DOM, I should be calling `ko.cleanNode` on them. (Or `ko.removeNode`?) Are these documented anywhere? I’m removing Knockout-bound elements all the time, but it sounds like they’re not getting cleaned up properly.
Right, but if I’m e.g. creating a dialog box, I should manually call `ko.removeNode` when closing the dialog box.
From: knock...@googlegroups.com [mailto:knock...@googlegroups.com]
On Behalf Of rpn
Sent: Saturday, February 25, 2012 0:38
To: knock...@googlegroups.com
Subject: Re: How to not leak memory
ko.cleanNode will recursively clean up the node and its children. ko.removeNode will call ko.cleanNode and then try to remove the element from its parent. If you are using the template/control-flow bindings, then this is done for you.
On Friday, February 24, 2012 11:32:13 PM UTC-6, Domenic Denicola wrote:
OK, this is pretty helpful, and should give me a solution for my two utility functions.
But, from this I gather that whenever I remove elements from the DOM, I should be calling `ko.cleanNode` on them. (Or `ko.removeNode`?) Are these documented anywhere? I’m removing Knockout-bound elements all the time, but it sounds like they’re not getting cleaned up properly.