I have been working with json files and angularjs,since i made changes to the json file to make it more complete with information, the structure of the file became more complex, now i can't access the data they way i used to. It's supposed to be the same way but it's not loading.
this is the jason: http://www.jsoneditoronline.org/?id=72e10a49f6f7650a864dda13a3f2d56a, (Note: estado=state, localidad=location i'm trying to display the locations from various states in a chosen select).
How i load json data into the html:
<select class="control-group chosen-select" chosen id='sl_edo' style="width:300px;">
<!-- also i tried ng-repeat="pueblo in pueblos" which worked with the old json file-->
<optgroup ng-repeat="pueblo in pueblos[0] | orderBy:'estado'" label={{pueblo.estado}}>
<option>{{pueblo.localidad}}</option>
</optgroup>
</select>
some tests i did to check how is the data structure
<p>{{pueblos[0].estado}}</p>
This line brings me this
[{"Jalisco":{"localidad":{"Tequila":,etc...
another html line i tested
<p>{{pueblos[0]}}</p>
{"estado":[{"Jalisco":{"localidad":{"Tequila"
estadohas an object oflocalidadkeyed on city name. Just look at the JSON and adjust your code accordingly. You might think it should be the same way, but it is not.