Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngModelWatch not triggering a second digest when it fires #5258

@dtabuenc

Description

@dtabuenc

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions