Extend an entity to create a computed observable that requires a navigation property

Posted by Julianyus on Stack Overflow See other posts from Stack Overflow or by Julianyus
Published on 2012-12-11T13:15:32Z Indexed on 2012/12/11 17:03 UTC
Read the original article Hit count: 189

Filed under:
|

I'm trying to extend an entity to create a computed observable that requires a navigation property:

app.domain.indicador = function () {
    this.ValorMetaActual = ko.computed({
        read: function () {
            console.log(this.ValoresMeta); //navigation property: undefined
            return 0;
        },
        deferEvaluation: true
    }, this);
};

The problem is that when the observable is created, the navigation property does not yet exist.

What could I do to fix this?

© Stack Overflow or respective owner

Related posts about knockout.js

Related posts about breeze