Reputation: 384
Give this object of objects: (filled with way more)
$scope.object = {
"activities":
{
"1": {
"name": "Watch a movie",
}
"2": {
"name": "Chill at home",
}
},
"people":
{
"1": {
"name": "with your best friend",
}
}
How can I fill my select with all names of activities?
Right now I have
Is it possible to do this?
Upvotes: 0
Views: 65
Reputation: 12004
Use ng-options:
<select ng-model="currentID"
ng-options="id as activity.name for (id, activity) in object.activities">
</select>
Upvotes: 3