using ng-model within nested ng-repeat directives

前端 未结 3 742
死守一世寂寞
死守一世寂寞 2021-01-03 23:54

I\'m trying to use ng-model \"within\" a ng-repeat directive that is itself nested in a ng-repeat directive.

The following jsfiddle demonstrates my problem and my tw

3条回答
  •  悲哀的现实
    2021-01-04 00:48

    You don't need to alter your model or access the $parent. What's missing is "track by $index":

        
            --                
                                
                 {{step}}
            
        
    

    Here it is in yr fiddle.

    More information: Angular ng-repeat dupes

    I'm not sure if track by existed yet when the question was asked, so the other answers may have been correct at the time, but in current Angular this is the way to go.

提交回复
热议问题