0

i'm following the instruction for ng-repeat in this link

Angular ng-repeat Error "Duplicates in a repeater are not allowed."

but in my case i use the ng-repeat in my combobox

here's my code for view(slim format)

md-input-container flex="50"
  label Period
  md-select name="type" ng-model="period"
    md-option ng-repeat=" period in periods track by $index" value="{{period.value}} track by $index"
      | {{period.name}}

and this is my controller(coffee script format)

  $scope.periods = [{ "id": 1 ,"value": 1.0 , "name": "amtopm" }, { "id": 2 , "value": 0.5 , "name": "amtoam" }, { "id": 3 , "value": 0.5 , "name": "pmtopm" }]

is this possible to resolve??

my error

Error: Duplicate md-option values are not allowed in a select. Duplicate value "0.5 track by $index" found.
at SelectMenuController.self.addOption (http://localhost:3000/assets/angular-material/angular-material.self-7da646f…0d815a4ab7457c1721ae7fe722ebb2b821ed2e8edb4651da9af5159.js?body=1:17597:15)
at setOptionValue (http://localhost:3000/assets/angular-material/angular-material.self-7da646f…0d815a4ab7457c1721ae7fe722ebb2b821ed2e8edb4651da9af5159.js?body=1:17769:18)
at Object.postLink (http://localhost:3000/assets/angular-material/angular-material.self-7da646fa80d815a4ab7457c1721ae7fe722ebb2b821ed2e8edb4651da9af5159.js?body=1:17719:7)
at http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:1248:18
at invokeLinkFn (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:9935:9)
at nodeLinkFn (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:9336:11)
at compositeLinkFn (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:8621:13)
at publicLinkFn (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:8501:30)
at lazyCompilation (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:8845:25)
at boundTranscludeFn (http://localhost:3000/assets/angular/angular.self-7f8df3e3ebe7623e233b951726e7da238883fa9e7a98b987ac7aecccf5f00510.js?body=1:8638:16) <md-option ng-repeat=" period in periods track by $index" value="{{period.value}} track by $index" tabindex="0" class="ng-scope" data-ng-animate="1">
Community
  • 1
  • 1
wiwit
  • 73
  • 1
  • 7
  • 26

0 Answers0