If I fetch a list of models in the init() of a can.Control and want to listen to changes in any of the models. How do I do this if none of the models have live binding setup?
The problem occurs when I issue any additional findAll calls. At that point the templated event binding stops working. Ideally, what I want is that on subsequent findAll calls, if any of the models have changed, my change function will be executed.
But it seems that if the model is not in the store (no live binding) that on subsequent findAll calls, the change event is not fired.
- init: function() {var self = this;can.when(myModel.findAll()).then(function(models) {self.options.models = models;self.on();});},"{models} change": function(StatusList, ev, attr, changeType, newVal, oldVal) {// Do something},update: function() {can.when(myModel.findAll()).then(function(models) {// Templated event binding no longer works because it is a new objectself.options.models = models;});}
Is there a way to do this?