(There are a ton of questions every day that link back to why can't I set the value of my observable, instead of having so many different answers saying the same thing I wanted to create a question to refer back to for everyone)
Setting value of Knockout Observable / Observable Array doesn't update
Setting the value of my observable observableArray isn't updating!
Adding an item to an Observable Array
Why can't I add an item into my Knockout observable array?
Setting value of Knockout Observable / Observable Array doesn't update
You need to use the setter function to update the value of your observable / observableArray -
Ex. 1 (observable) -
Ex. 2 (observableArray) -
Note See this Question to understand why this probably not what you are trying to do - What is the best way of cloning/copying an observablearray in knockoutJS?
Adding an item to an Observable Array
You need to push the item into the observableArray, not the underlying value of the observableArray -
Creating a model to use/share in your view model
You can create a re-usable model to use in your view models. This is similar to using a class in C# to create objects that have common properties.
Which can be created like -
Which could also be done by parameters instead of just objects -