Hi I seem to be having a problem with KO array bindings not applying.. Here is my code:
var movements_array = [];
var viewModel = {
movements: ko.observableArray(movements_array),
};
$(document).ready(function(){
ko.applyBindings(viewModel);
});
function get_alteration_movement(){
for(var i = 0; i < index.movements.length; i++)
{
movements_array[i] = index.movements[i].description;
console.log(movements_array);
viewModel.movements(movements_array);
console.log(viewModel.movements);
}
}
Index is JSON data fetched from another js page.