I found this question to be similar as mine - Replace all elements in Knockout.js observableArray
I just have another question - if I replace all the elements of observableArray
with new contents, will that reflect in the UI
as well?
Here's the scenario: I have a html
file which displays a table
full of contents. Here is my js
code snippet which fetches the data bound between js
and html
-
var table = ko.observableArray(); // {1,2,3,4,5} - UI shows 1,2,3,4,5 in the table
// now I replace all the contents
table = {6,3,8,9};
// **will the UI display the updated content, which is {6,7,8,9} in the table? Or will it still display {1,2,3,4,5}?**