angularjs ng-options nested json data

旧巷老猫 提交于 2019-12-06 05:09:31

I fixed some issues in your code.

JSFiddle demo

The first input was correct:

<select ng-model="selectedRegion" ng-options="region.countryName for region in eyebrow.regionSelector"></select>

But in the second, I changed several things:

  • Set ng-model to a different variable (selectLang), it's cleaner.
  • ng-options loops over selectedRegion.regionSelector, instead of just selectedRegion. That was your main mistake here:

<select ng-model="selectLang" ng-options="lang for lang in selectedRegion.selectLang"></select>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!