The following data is in ko.observableArray cars: (this is the dump of the array)
[
{
"carId": 1,
"carName": "Ford",
"carStatus": "On-Hold",
"carDescription": "This is the first car description."
},
{
"carId": 1,
"carName": "Toyota",
"carStatus": "On-Hold",
"carDescription": "This is the second car description."
}
]
View
<ul data-bind="foreach: cars()">
<li>
<span data-bind="text: carDescription"></span>
</li>
</ul>
However, nothing is output, there are no list items showing.
foreach: cars()feels strange because foreach unwraps observable automatically. Try with<ul data-bind="foreach: cars">foreach: cars(), instead offoreach: cars, is not recommended it won't prevent rendering. Here is a fiddle that shows it working: jsfiddle.net/jearles/UzC38