9 ms·
What's the party line on one-way automatic data binding? Even that could save quite a bit of manual effort.
by bobspryn 15y ago
What's the party line on one-way automatic data binding? Even that could save quite a bit of manual effort.
- jashkenas 15y agoFor many views, this is all you need: this.model.bind("change", this.render); ... but you can be as fine-grained about it as you like.
- bobspryn 15y agoSure, but if I only want certain pieces of the view to update when their corresponding model value changes, as opposed to re-rendering the whole view, I have to build an update method that does so. Not horrible in the scheme of things, but awful nice to not build manually. Is Amber.js essentially re-rendering views in their entirely, or is it more precise with its binding updates? Another difference I suppose would be binding classnames and attributes to your model may require several lines of jQuery to manipulate, vs I believe in amber.js its done by naming convention and an options object (to use different class names).