> Knockout seems to react only to changes in the observableArray itself,
> like when you do slice, push, pop etc
Yes, Alexander is right - observableArray is a way of tracking which
items are in a collection, not a way of making everything referenced
through the whole object graph observable. There's some documentation
about observable arrays at
http://github.com/SteveSanderson/knockout/wiki/observable-arrays.
JavaScript doesn't fire any sort of event when arbitrary properties
change, so there's no way KO can notice what's changed inside an
object unless you've made that specific property observable.
Observable arrays don't try to scan the whole object graph to convert
everything to observables because in many cases you wouldn't want to
do such a dramatic thing, and you might have references to things that
get confused if you interfere with their properties (for example, your
object graph might include a reference to a DOM element or the
"window" object).
However, in the case where you do want to do that, some utility code
like Alexander's will work. You could try to generalise it but it's
probably clearer and more robust as it is.
> With this, is your array linking affected? The properties which I
> explicitly make observable are now not linked within the array.
Could you clarify what you mean? Ideally if you could post a code
example it would be easiest to suggest what's happening.
Regards!
Steve