2

I'm trying to get the following code to run:

<tr ng-repeat='row in rows'>
    <td ng-repeat='num in row track by $index' id='{{idNum[row][num]}}'>
</tr>

idNum in this case is a 2D array of integers (0 to 41), but it doesn't seem to receive the first '[row]' value. I can only inset the '[num]' variable to return an array i.e. [0,1,2,3,4,5,6], but I'd like to get the values inside the array instead. Is there anyway to do this?

MoSheikh
  • 769
  • 1
  • 11
  • 20
  • 3
    try this `id='{{idNum[$parent.$index][num]}}'` – Hadi J Jun 15 '16 at 18:50
  • Can you include the controller's code as well? It'll be helpful to see the code definitions of things like `rows` and `idNum`. – V Maharajh Jun 15 '16 at 18:53
  • @SSH perfect, thank you. I thought I could refer to the parent index with the variable but this works exactly how i need it. – MoSheikh Jun 15 '16 at 18:55
  • Possible duplicate of [Access index of the parent ng-repeat from child ng-repeat](http://stackoverflow.com/questions/14807258/access-index-of-the-parent-ng-repeat-from-child-ng-repeat) – fracz Jun 15 '16 at 19:36

0 Answers0