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

Change detection should report the previous value #1265

Open
vicb opened this issue Jul 25, 2014 · 0 comments
Open

Change detection should report the previous value #1265

vicb opened this issue Jul 25, 2014 · 0 comments

Comments

@vicb
Copy link
Contributor

vicb commented Jul 25, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant