-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ngModel.$setViewValue should return a promise #11423
Comments
I can see that the use case is that you want to re-render the directive when the user interacts, which happens to occur when you hit First of all, why does the widget need re-rendering, when you are writing to the Or am I missing something? Is it that the |
Currently we have code that executes What this means is that when |
So a question to ask is are you using $render correctly in this case? |
I didn't write the code, so I can't say :) . One would normally call $render after calling $setViewValue, no? |
$setViewValue is generally called after the user changes an input: it extracts the value from the input and sets it on the ngModel. $render needs to be called after the model changes to update the input. |
Really |
I see - it would appear that UI Bootstrap likely is using $render & $setViewValue incorrectly here. Closing as invalid. |
Fyi, I did some digging into the usage of $render & $setViewValue in UI Bootstrap. The intention call the $formatters programmatically due to a change in configuration that would affect the formatting of the model value. A PR has been opened for that: #10764 |
In the case of a debounced value update, currently
$setViewValue
does not allow the user to detect when the update is truly executed, resulting in a potentially premature call to$render
- this affects the UI Bootstrap datepicker. If ngModelOptions has no debounce, it should then resolve immediately.The usage should be promise based, so it can support code like
The text was updated successfully, but these errors were encountered: