Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. // around line 666...
  2. _transitionStart(...): Promise<NavResult> {
  3.  
  4. // ...
  5.  
  6. // around line 700...
  7.  
  8. // create a callback that needs to run within zone
  9. // that will fire off the willEnter/Leave lifecycle events at the right time
  10. transition.beforeAddRead(this._viewsWillLifecycles.bind(this, enteringView, leavingView));
  11.  
  12. // ...
  13.  
  14. }
  15.  
  16. // around line 805...
  17. _viewsWillLifecycles(enteringView: ViewController, leavingView: ViewController) {
  18. if (enteringView || leavingView) {
  19. this._zone.run(() => {
  20. // Here, the order is important. WillLeave must be called before WillEnter.
  21. leavingView && this._willLeave(leavingView, !enteringView);
  22. enteringView && this._willEnter(enteringView);
  23. });
  24. }
  25. }
  26.  
  27. /**
  28. * Add a function which contains DOM reads, which will run
  29. * before the animation begins.
  30. */
  31. beforeAddRead(domReadFn: Function): Animation;
  32.  
  33. // around line 743...
  34. _transitionFinish(...): NavResult {
  35.  
  36. // ...
  37.  
  38. // around line 753...
  39. if (hasCompleted) {
  40. // transition has completed (went from 0 to 1)
  41. if (enteringView) {
  42. enteringName = enteringView.name;
  43. this._didEnter(enteringView);
  44. }
  45.  
  46. // ..
  47.  
  48. }
  49.  
  50. // ...
  51.  
  52. }
  53.  
  54. // around line 939...
  55. _didEnter(view: ViewController) {
  56. assert(this.isTransitioning(), 'nav controller should be transitioning');
  57. assert(NgZone.isInAngularZone(), 'callback should be zoned');
  58.  
  59. try {
  60. view._didEnter();
  61. this.viewDidEnter.emit(view);
  62. this._app.viewDidEnter.emit(view);
  63. } catch (e) {
  64. this._errHandler && this._errHandler.handleError(e);
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement