Hi, Since there is a single scope of controller "MappingLimits", all its properties are being shared across rows . You may use the following strategies:
1. Create separate scope for each row. This can be achieved by either creating a custom directive which wraps around the row or you can create new instance of a controller. The latter is illustrated below: <tr ng-controller="RowController" ng-repeat="item in items> </tr> For more details please refer to plunker: https://plnkr.co/edit/l0U9fvQi9a8B9m0J7k5R?p=preview 2. You can create models and collections for each row by converting them into index based data structures. Please refer to the following plunker: https://plnkr.co/edit/l0U9fvQi9a8B9m0J7k5R?p=preview I have converted $scope.leagueList from an array to array of arrays. Personally I would suggest the first approach as it looks clean. The only drawback is that getLeaguecategories function gets defined multiple times for each row. I hope this helps. Regards, Vaibhav Gupta On Monday, 18 April 2016 08:21:12 UTC+5:30, Enrique del Bosque wrote: > > I can't find a way to restrict the action triggered by ng-change to only > the row operated by the user. So, if user selects "League" on dropdown 1, > two dropdowns should be displayed on the "Available Items" column. The one > from the top lets you select a sport, when selected, down dropdown should > display league options. The problem now is that all dropdowns from the > table get populated (you can see that if you select "league" on another > dropdown, league options are already displayed before you select your > sport). What I need is to restrict function's action only to row operated > by user. > > Here's a fiddle: > > https://embed.plnkr.co/kAiLw40hUvnLk9jv86aj/ > > > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
