You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if many people are on board with this as I am, but if you have a simple model that has an Array as an attribute, if you do var something = kb.observable(model, "arrayProperty") you don't get the value of the array in something, only the full model.
How about having a kb.observableArray(model, "arrayProperty") any subsequent changes to the observable Array would trigger a set on the model, and the other way around.
The text was updated successfully, but these errors were encountered:
My bad - I had a typo and was using ko.observable instead of kb.observable, actually a kb.observable is created (although it is not a ko.observableArray), anyway, I made that array into a collection following the advice here as I might need to change that (i.e. not only a read only array). Anywhoo, I don't know if transforming that into an observableArray will be so useful given the workarounds:
We have been using BackboneORM, but in the past we used BackboneRelational to handle nested arrays. They will create kb.collectionObservables (which are ko.observableArrays). Or you can just use a collection as you did.
Hi!
I don't know if many people are on board with this as I am, but if you have a simple model that has an Array as an attribute, if you do
var something = kb.observable(model, "arrayProperty")
you don't get the value of the array in something, only the full model.How about having a
kb.observableArray(model, "arrayProperty")
any subsequent changes to the observable Array would trigger a set on the model, and the other way around.The text was updated successfully, but these errors were encountered: