Everything is loading correctly with the code below, but the default option is not being selected.
In addition, one of the dropdown items has a value for option.groupJID
that matches with
MyCtrl.groupJID = [email protected]</a>
<select id="groups-list2" ng-model="MyCtrl.groupJID"
ng-options="option.groupJID as option.profile.name for option in MyCtrl.userGroups track by option.groupJID">
</select>
Please take a look
https://i.sstatic.net/NTKfd.png https://i.sstatic.net/7FmLm.png
Function:
SomeNetworkCall.then(function(success){
MyCtrl.groupJID = success.peer; //'[email protected]'
MyCtrl.userGroups = success.groups;
});
success.groups:
[
{
"groupJID": "[email protected]",
"profile": {
"name": "Flock Desktop Dev - QA issues",
"description": "QA/Dev Channel"
}
},
{
"groupJID": "[email protected]",
"profile": {
"name": "Some group name",
"description": "awesome Channel"
}
}
{
"groupJID": "[email protected]",
"profile": {
"name": "Flock Desktop 1",
"description": "QA/Dev Channel"
}
},
{
"groupJID": "[email protected]",
"profile": {
"name": "Flock Desktop 2",
"description": "QA/Dev Channel"
}
}
]