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.

$scope.$watch doesn't see DOM changes done in current $digest cycle, but sees them in next cycle #10522

Closed
@olexme

Description

@olexme

Specifically it doesn't see changes made for class attribute by ng-class directive.
The issue occures for AngularJS v1.3.7, for Angular 1.2.26 is ok.
Below is easy to analyse fure Angular plunker example, with $watch based on function checking class attribute changes in each digest cycle (or more times per digest).
Steps to reproduce the issue:

  1. click checkbox to apply "redClass" style on Foo Paragraph (it becomes red)
  2. click "No Operation" button to poke next digest cycle and observe that $watch now "sees" applied redClass
  3. switch to Angular 1.2.26 to see the difference in behaviour

http://plnkr.co/edit/sTjGayZnG8ti6X6LgElZ?p=preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions