Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checklist won't update if using track by $index inside ng-repeat #46

Closed
duc-q opened this issue Oct 20, 2014 · 4 comments
Closed

Checklist won't update if using track by $index inside ng-repeat #46

duc-q opened this issue Oct 20, 2014 · 4 comments

Comments

@duc-q
Copy link

duc-q commented Oct 20, 2014

I've been using checklist-model to work with an array of check-boxes with each selected one can be deleted. Everything seems to work fine until I use it inside a ng-repeat.

The problem is, the deleted check-boxes still be there around when I add the track by $index along with the ng-repeat. If I remove that track by, it works fine (but in my real app I need that track by to work).

Here's a plnkr, http://plnkr.co/edit/5082nJfGwlOZaXYb184Z?p=preview

To see the problem, you can follow these steps.

1.Select any check-box you want
2/Delete those selected ones
3.Check the check all button to see,

Now look at the one with track by $index, it will leave some check-box unchecked. If you check it manually, it will have the old value added to the list. This is weird.

@sazo sazo added the bug label Feb 15, 2015
@sazo
Copy link
Collaborator

sazo commented Feb 15, 2015

@DieByMacro Thx for repporting will look in to it in time.

@imdadul
Copy link

imdadul commented Feb 16, 2015

You can solve your problem using track by verb.id
http://plnkr.co/edit/izniQzjYZ6IWdnUysce9?p=preview

Thanks.

@beradrian
Copy link
Collaborator

The problem is that you have track by $index and checklist-value='verb.id'. If they both set to either $index or verb.id it works.
I will change this one from bug as it works as expected, maybe clarify in the docs.

@beradrian
Copy link
Collaborator

Clarified in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants