knockout.js - How to set knockout variable from array element -
I have to face some finger with it:
Perhaps the difference is that you myVal The values of
are set in the first object before the array is actually populated. To see if you have console.log (self.myArray () [0])
First, self.myVal
is set up, you should see what is happening. Since you are setting it to O. Nly once it is not subscribed to change in array I If you wanted to do this then you would calculate.
self.myVal = ko.computed (function () {return self.myArray () [0];});
will now be counted whenever anything will be added or removed from myArray
Comments
Post a Comment