rivets icon indicating copy to clipboard operation
rivets copied to clipboard

"if" binder

Open milonas115 opened this issue 9 years ago • 1 comments

Is there a reason why the "if" binder recreates the model? This causes strange errors when working with rv-on-* events. Since the event passes the model, it's passing the new model instance, not the model that rivets was binded to (obviously making any changes do not get reflected to the original model). I circumvented this by just passing "this.view.models" directly.

(this.nested || (this.nested = new Rivets.View(el, this.view.models, this.view.options()))).bind();

I picked up on one strange side effect, in which the default sightglass adapter's "stubFunction" method ended up with an undefined callback (I just added a check to make sure it was an actual callback). Was wondering if this would cause any other side effects?

milonas115 avatar Mar 06 '17 19:03 milonas115

See https://github.com/mikeric/rivets/issues/512 and propposed fix at https://github.com/mikeric/rivets/issues/486#issuecomment-239181967

blikblum avatar Mar 06 '17 20:03 blikblum