I am trying to use track by with object which throws above error because I have duplicates key. All I am trying to do is initialised select box with an option.
HTML:
<md-select ng-model="$ctrl.metric">
<md-option ng-value="opt.value" ng-repeat="opt in $ctrl.obj track by opt.value">
{{opt.label}}
</md-option>
</md-select>
JS:
this.obj = {
label: 'High',
value: {
$gte: 0,
$lte: 2
}
},
{
label: 'Low',
value: {
$gte: 3,
$lte: 4
}
}
this.metric = {
$gte: 3,
$lte: 4
}
$ctrl.metricdoes not contain the label property.