1

most of Aurelia github examples says we need to call configure() inside the constructor() method ex:

 constructor(router) {
    this.router = router;
    this.configure();
  }

  configure() {
    this.router.configure(config => {
      config.title = 'Aurelia';
      config.map([
        { route: ['','welcome'],  moduleId: 'welcome',      nav: true, title:'Welcome' },
        { route: 'flickr',        moduleId: 'flickr',       nav: true },
        { route: 'child-router',  moduleId: 'child-router', nav: true, title:'Child Router' }
      ]);
    });    
  }

but i noted latest example had method configureRouter(config, router) which looks self executing without calling form different method. (or at least i cant find it ) any way how can we find the complete page lifecycle of Aurelia (throughout the screen activation lifecycle)?

Ruwanthaka
  • 39
  • 1
  • 8
  • The router config is done like this: https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-es2016-webpack/src/app.js – Callum Linington May 13 '16 at 07:53
  • This shows how aurelia executes something on the activation of a route: https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-es2016-webpack/src/users.js – Callum Linington May 13 '16 at 07:54
  • I can't find in the docs anything about the router stuff, however I do know there is an activate and deactivate both you can return promises from if you want to do async functions before its loaded – Callum Linington May 13 '16 at 07:57

1 Answers1

0

This eBook is not completed "https://leanpub.com/aurelia-for-real-world-applications" only 60% yet. any way looks there are five methods are called in the following order.(throughout the screen activation life-cycle).

1) configureRouter(config, router)
2) canActivate(params, routeConfig, navigationInstruction)
3) activate(params, routeConfig, navigationInstruction)
4) canDeactivate()
5) deactivate()
Ruwanthaka
  • 39
  • 1
  • 8