I'm using Knockout and Knockout-REST (which does the mapping and makes all objects observable):
<script> var regosViewModel = new RegosViewModel();</script>
<span data-bind="text: regos().list()[0].rid()"></span>
<table class="table table-striped">
<thead><th>rid</th></thead>
<div data-bind="foreach: regos().list()">
<tr><td data-bind="text: rid()"></td></tr>
<script>ko.applyBindings(regosViewModel);</script>
The span is returning the number 1, but trying to do the same within the foreach loop below leads to "Error: Unable to parse bindings. Message: ReferenceError: Can't find variable: rid; Bindings value: text: rid()".
Can anyone explain why? Of note, text: $index also has the same bindings error.
trand delete the div: e.g:<tr data-bind="foreach: regos().list()><td data-bind="text: rid()"></td></tr>- nemesv