<div ng-repeat="(key, value) in dataSet | groupBy: 'partner.partnerName'">
<md-select ng-model="userName" placeholder="{{ key }}" class="partnerUser" >
<md-option >{{ key }} </md-option>
<md-option ng-repeat="chatMsg in value" value="{{chatMsg.role.userId}}">{{ chatMsg.role.userId }} </md-option>
</md-select>
</div>
Using the code above, multiple mdSelect directives are being generated. However, only one mdSelect can be selected out of many, and the value should be assigned to the model ng-model="userName". Is there a way to bind with one mdSelect model that can be referred to later?
$scope.dataSet =
[{userName:'user1',partner :{partnerId:'1',partnerName:'firstPartner'}},
{userName:'user2',partner:{partnerId:'2',partnerName:'secondPartner'}},
{userName:'user3',partner:{partnerId:'1',partnerName:'firstPartner'}},
{userName:'user4',partner:{partnerId:'2',partnerName:'secondPartner'}
}];
I have data like this, and based on partner ID, records will be added to different Md-selects.