Re: Adding a new observable to existing viewmodel

72 views
Skip to first unread message
Message has been deleted

Michael Best

unread,
Sep 30, 2016, 7:31:07 PM9/30/16
to KnockoutJS
Are you saying you want to add an observable property on demand? What's your trigger for adding it? Is the error that you're trying to read it before it's added?

-- Michael

On Friday, September 30, 2016 at 11:54:40 AM UTC-7, Andrew Thomas wrote:
I added a new observable to an existing viewmodel and it works as expected if a new or saved object does not contain this particular (node, child, element) but if it does have one it breaks (reference error).
My newbie solution is run an update to the data source containing the stored values knockout reads when loading but I was thinking instead of messing with 100's or more databases, knockout would allow me to catch this and correct it.
Unfortunately I don't know how to go about this or what level of the code base should this really happen. Is there an easy method in knockout that I am overlooking to handle missing properties?
Reply all
Reply to author
Forward
Message has been deleted
0 new messages