mikeric / rivets

Lightweight and powerful data binding.
http://rivetsjs.com
MIT License
3.23k stars 310 forks source link

How to reset bindings? #453

Open maxkoshel opened 9 years ago

maxkoshel commented 9 years ago

I have some preloaded data and binded with rivets. Some of this data can generate dynamically new elements with binding. What is right way to reset (or reinitialize) bindings when new data appears?

PierBover commented 9 years ago

According to the guide:

Every call to rivets.bind returns a fully data-bound view that you should hold on to for later. You'll need it in order to unbind it's listeners using view.unbind().

tayfunyugruk commented 9 years ago

@maxkoshel do not forget to unbind the dynamc view when it's parent is removed programmatically.