Cleanup watchers
Opened this issue · 1 comments
JrSchild commented
As far as I can tell there is no documented way of cleaning up watchers. Usually in a single page app with controllers you'd like to be able to unwatch the data when the controller is destroyed. This way you avoid generating unnecessary overhead. If the watcher can't be cleaned up, a reference to that function has to stay in memory and the whole controller will never be destroyed and garbage collected. Angular solves this by returning a function that can be called to automatically unwatch that function.
Any thoughts on this?
stuk88 commented
+1