-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Programmatic updates of the model in ngModelOptions #6994
Comments
The first one is solved by fixing up what We simply call
@shahata - if you agree, do you want to knock up a PR with this fix. It would need to have a unit test that fails without the fix. Something like:
|
It may be that we should refactor the $cancelDebounce function but the sentiment is still the same. |
Regarding the second problem, using |
Yes, I agree those issues can be resolved by forcing an update of the view, that's exactly what I was going for. As for the second issue, here's a more realistic example: http://plnkr.co/edit/kjMG4K?p=preview - the idea here is that the second input uses |
What if we had a method called |
Actually a more robust option (since this $setModelValue() doesn't actually modify the "real" model) would be to have a |
I agree |
Sadly there are still issues with programmatic updates of the model in the new
ngModelOptions
:http://plnkr.co/edit/C8IzuF?p=preview
clear
button. The debounced is canceled alright, but the value in the input is not reset. :( This obviously happens because the model update did not reach the view since the model was not actually changed. Maybe this can be fixed by forcing a view update when debounce is canceled?{updateOn: 'focus'}
, so if we enter a value and then click theclear
, the value also is not reset. This is essentially the same issue as the previous one, but here I don't have a good suggestion because we don't have anything like the$cancelDebounce()
to indicate us to force the view change.What do you think?
I'll be glad to take this PR, but first I think we should discuss a strategy of how to solve it.
The text was updated successfully, but these errors were encountered: