using ng-model within nested ng-repeat directives

前端 未结 3 770
死守一世寂寞
死守一世寂寞 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:34

    Your first solution seems to be correct.

    This appears to be a bug, introduced in the unstable branch of angularJS (you are using 1.1.4, which is unstable - the stable version, 1.0.6, works as expected)

    EDIT:

    Turns out this isn't a bug, but a new feature - the ngRepeat directive now allows for a tracking function to be defined (associating the model's id with the DOM element), and no longer allows for these tracking variables to be repeated. See the corresponding commit, the docs for 1.1.4 on ngRepeat and the changelog

提交回复
热议问题