Hi I'm trying to do a foreach using a observableArray and I'm getting no result.
Where as in javascript file while debugging the data is getting loaded with the array. The html code is given below:
<!-- ko foreach: currencyarr -->
<option data-bind="value:id, text:label"></option>
<!-- /ko -->
And the JSON file content is as follows:
"name" : "shuvagho",
"curarr" : [
{"id": "inr", "label": "INR"},
{"id": "usd", "label": "USD"},
{"id": "aud", "label": "AUD"},
{"id": "sgd", "label": "SGD"}
]
And the javascript code using knockout js is as follows:
self.currencyarr = ko.observableArray();
self.currencyarr(data.curarr);