backbone.epoxy icon indicating copy to clipboard operation
backbone.epoxy copied to clipboard

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

Open vans163 opened this issue 10 years ago • 0 comments

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.

vans163 avatar Jul 09 '15 02:07 vans163