I have a dropdown in one of my divs from which I select the number of dropdowns to be in the second div. My task is to be able to select different values โโfrom each drop-down list in the second div. Here is the code I'm trying
<div ng-repeat="i in getNumber(secondN2.core.r1r2.value) track by $index"> <div> <strong><u>For Core link number {{$index+1}}:</u> </strong><br> <strong>Select IM</strong> <select ng-model="im" ng-change="calculate()" > <option value="1 Gig" selected="selected">1 Gig</option> <option value="10 Gig">10 Gig</option> </select><br> </div> </div>
secondN2.core.r1r2.value is a number, I convert it to an array, a collection, returning a new array (n) in the getNumber method
How to give the correct ng-model in this case? And how to get the values?
If I try to give i.im , it still will not help. When im , $scope.im goes undefined
Update
What are two nested loops there
<div ng-repeat="j in secondN3.core" style="border:1px solid;"> <strong>Configure Core Links between {{j.name}}</strong><br><br> <div ng-repeat="i in getNumber(j.value) track by $index"> <div> <strong><u>For Core link number {{$index+1}}:</u> </strong><br> <strong>Select IM</strong> <select ng-model="secondN3.coreValues[[$parent.$index,$index]]" ng-change="calculate()" > <option value="1 Gig" selected="selected">1 Gig</option> <option value="10 Gig">10 Gig</option> </select><br> </div> </div> <div>
Edit: 2
It works: It is a plunker for this
source share