B
B
bullycoder2015-06-03 06:42:15
ASP.NET
bullycoder, 2015-06-03 06:42:15

How to make viewmodel observable?

Using KNOCKOUT MVC, I needed to change the whole model at once, but the dynamically generated viewmodel is not observable. How to proceed here?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asdz, 2015-06-06
@asdz

Well maybe like this:

ViewModel.prototype.update = function (data) {
    this.SomeProperty(data.SomeProperty);
    this.SomeProperty2(data.SomeProperty2);
}

or bypass all data properties and update those present in the ViewModel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question