I want do a dependen select / dropdown.
I obtain this json sample:
[
{
"id": 15695,
"username": "user1",
"address": {
"id": 16794,
"location": "O Treviño de San Pedro"
},
"jobs": [
{
"id": 7562,
"name": "ut"
},
{
"id": 7565,
"name": "temporibus"
},
{
"id": 7603,
"name": "perspiciatis"
},
{
"id": 7622,
"name": "optio"
}
]
}
]
This is the angular code:
<select ng-model="industrialist.user" ng-options="user.id as user.username for user in users"></select>
<select ng-model="industrialist.job" ng-options="job.id as job.name for job in industrialist.user.jobs"></select>
If I do this code, then dependent select works but then i haven't de correct key in industrialist.user.
<select ng-model="industrialist.user" ng-options="user.username for user in users"></select>
What can I do?
Thanks
ng-model="industrialist.user"but differentng-options. Please explain issue in more detail