You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
The watch no longer returns any value. So the current digest will never be marked as dirty even though the watch has performed actions that should require a second pass through the digest loop.
I think the fix is probably just returning the value we get from ngModelGet($scope). This will allow the digest to compare the previous value and mark itself as dirty if necessary.
Does anyone see a problem with this approach? If not I can submit a PR.
The text was updated successfully, but these errors were encountered:
…propriate
Due to an earlier change, ngModelWatch() no longer returns a value to the
caller. This means the digest loop has no way to tell if the watch actually
modified anything and so can not schedule another pass.
This means any watches that watch form or model controller changes
(e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch()
will not be able to see any changes made therin.
This commit fixes this behavior by returning the latest evaluated ng-model
value.
Closesangular#5258
…propriate
Due to an earlier change, ngModelWatch() no longer returns a value to the
caller. This means the digest loop has no way to tell if the watch actually
modified anything and so can not schedule another pass.
This means any watches that watch form or model controller changes
(e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch()
will not be able to see any changes made therin.
This commit fixes this behavior by returning the latest evaluated ng-model
value.
Closesangular#5258Closesangular#5282
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
…propriate
Due to an earlier change, ngModelWatch() no longer returns a value to the
caller. This means the digest loop has no way to tell if the watch actually
modified anything and so can not schedule another pass.
This means any watches that watch form or model controller changes
(e.g. watches on form.$valid) that are scheduled prior to an ngModelWatch()
will not be able to see any changes made therin.
This commit fixes this behavior by returning the latest evaluated ng-model
value.
Closesangular#5258Closesangular#5282
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When
ngModelWatch
gets called, it can potentially change the validity of the form control and update the respective controllers.Code in the template could be potentially binding to these values such as doing
{{myForm.$valid}}
.You can see the issue in this plunkr:
http://plnkr.co/edit/MC5NZ0AXlqA3XnNCVyzb?p=preview
The problem is that ever since this commit:
e6d9bea
The watch no longer returns any value. So the current digest will never be marked as dirty even though the watch has performed actions that should require a second pass through the digest loop.
I think the fix is probably just returning the value we get from
ngModelGet($scope)
. This will allow the digest to compare the previous value and mark itself as dirty if necessary.Does anyone see a problem with this approach? If not I can submit a PR.
The text was updated successfully, but these errors were encountered: