Nested scope is destroyed 2 times because of nesting routing leave order

I change a nested routing structure, and I am getting this error:

#0 Scope.destroy (package:angular/core/scope.dart:295:12)
#1 NgView._cleanUp (package:angular/routing/ng_view.dart:141:19)
#2 NgView._show.(package:angular/routing/ng_view.dart:114:15)

The reason is that parent routing leave is detaching the ng-view.


I change the leave test (in the pullrequest), to check the order of leave callback execution. For routing like this
Parent -> Child
the current execution is
Parent.leave and then Child.leave

It should be Child.leave and then Parent.leave.