remy / bind.js

bind.js - simple two way data binding to HTML and callbacks
694 stars 62 forks source link

Pushing a new item in array doesn't 'watch' children property #31

Open LethOsias opened 7 years ago

LethOsias commented 7 years ago

If we have a structure like below and we push a new skills object, the orders property on the new inserted objected will not be AugmentedArray and so the watch on this array never happens:

Is this a bug, desired functionality, or am i missing something? Thanks

var player = Bind({
  skills: [{
    name: 'skills0',
    orders: []
  }, {
    name: 'skills1',
    orders: [{
      orderName: 'order1',
      orderId: 1
    }, {
      orderName: 'order2',
      orderId: 2
    }, {
      orderName: 'order3',
      orderId: 3
    }]
  }]
}, {
  skills: {
    dom: '#skills',
    callback: function(value) {
      console.log(value);
    }
});