gmac / backbone.epoxy

Declarative data binding and computed models for Backbone
http://epoxyjs.org
MIT License
615 stars 89 forks source link

Epoxy.Model({ coll: new Collection() computed: deps: ["coll"] ... Does not trigger update #125

Open vans163 opened 9 years ago

vans163 commented 9 years ago

This code for example:

overview = Epoxy.Model.extend({
        defaults: {
            accounts: new accCollection(),
        },
        computeds: {
            deps: ["accounts"],
            totalAccounts: function() {
                return this.get("accounts").length;
            },
        },
    });

Does not trigger computeds to recompute when a member is added to the collection via .add.

If accounts: [], everything works great, appending an element triggers computeds to recompute.