Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Change detection should report the previous value #1265

Open
@vicb

Description

@vicb

The following code

  var ast  = astParser('a.b.c');
  var b = {'c': 1};
  var a = {'b': b};

  context['a'] = a;

  watchGrp.watch(ast, (v, p) => print('c: $p -> $v'));

  print('** Init');
  watchGrp.detectChanges();

  b['c'] = 2;
  print('** Change c');
  watchGrp.detectChanges();

  print('** Change b, c');
  a['b'] = {'c': 4};
  b['c'] = 3;
  watchGrp.detectChanges();

results in:

** Init
c: null -> 1
** Change c
c: 1 -> 2
** Change b, c
c: 3 -> 4

whereas it should result in

** Init
c: null -> 1
** Change c
c: 1 -> 2
** Change b, c
c: 2 -> 4

relates to #1113

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions