Complete knockout.js newbie here. I'm having some trouble understanding how knockout.js works. Any help is appreciated.
I have a JSON model that I get back asp.net MVC that looks like somethings like this -
var model = [{
"Personal": {"Name" : "Something"},
"Address": [
{"City" : "Some City"}
{"City" : "Some Other City"}
{"City" : "3rd City"}
"Relationships": [
{"Affiliation" : "Aff1"},
{"Affiliation" : "Aff2"},
]
]
var viewModel = ko.mapping.fromJS(model);
ko.applyBindings(viewModel);
Then, in my view I'm trying to do this -
<div data-bind="template: {foreach: Address}">
<span data-bind="value: City"></span>
</div>
I get an 'Unable to parse bindings, Address is not defined' error. What am I doing wrong?