-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
fixes #104 #105
fixes #104 #105
Conversation
I don't think removing that check is good. Maybe checking oldValue against undefined or something similar. Also, could you please write a test for this case? |
What harm could it do? (Not having that check) Looks like only an optimization to me. In the "add" and "remove" function there are also checks to prevent adding a duplicate and removing something that is not there. Kamil Pękala Dnia 21 lis 2015 o godz. 20:30 Adrian Ber [email protected] napisał(a):
|
Indeed, an optimization. But if it can be fixed without removing that optimization, even better. |
But that optimization actually only saves us the check of whether the item already is in the array or already isn't. It's not heavy computation that would have any impact. Also this situation afaik should happen only when the component is initialized. Why else would a watcher function be fired with old and new values being equal later on? Also - can you think of another solution that would fix my bug? |
I'm having the exact same problem and would love to see this PR merged. Don't really see the problem with removing this optimisation either, and no other (or better) way of fixing this show-stopping bug. |
What do you think about this http://plnkr.co/edit/bQmry6aaCZzR8TQmASLW?p=preview ? Please comment on these two solutions so I can include the fix and release a new version asap. Many thanks for your involvement. |
Looks like it solves my problem so, fine by me! Thanks. |
Awesome, thanks! Can you ping us when a new version is released? |
I added this comment to issue #104 too. What happens if there is an inconsistency between ngModel and checklistModel? Let's say that ngModel is true, but checklistModel doesn't contain the value? Or the other way around? Why don't you use As soon as we clarify this I can release a new version. |
@kevinrenskers, you can use https://sibbell.com to watch for GitHub releases. |
I think the checklist model should just always reflect the state of the checkboxes. Why don't i use it for initialization? I guess i could but it seems like a workaround. Kamil Pękala Dnia 4 gru 2015 o godz. 10:54 Adrian Ber [email protected] napisał(a):
|
Actually, in this case using ngModel for initialization is more like a workaround. All the checkboxes are bound to |
Ah I see what you mean. I use checklist-model in this case just do have validation, i.e. I don't save to db the actual checklist but the boolean flags itself. I use the checklist to validate its length because i require that at least one checkbox is selected. I will try to initialize the checklist with the values of the boolean flags. Unless you see a better solution to my scenario? |
Preinitializing checklist fixed the problem |
No description provided.