How to bind property on parent object with knockoutjs?

Viewed 79

I'm developing a application with knockout.js framework. I have one viewmodel like that:

var MyViewModel= {
    Id: ko.observable(),
    CountryCode: ko.observable(),
    NormalizedAddress:
        {
            COUNTRY_CODE: ko.computed(function () { return this.CountryCode(); }),
            Street: ko.observable(),
            ZipCode: ko.observable(),
            AreaCode: ko.observable(),
            Town: ko.observable(),
            Description: ko.observable()
        }

When I run my application, I obtain one exception like that:

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'CountryCode'

Can you help me to resolve my problem?

Thank you a lot, Marco

1 Answers
Related