Skip to content

Commit

Permalink
fix(router): error when it can't initialize property
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Apr 29, 2018
1 parent 19e5df9 commit e56b2ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/components/router/router.tsx
Expand Up @@ -53,14 +53,17 @@ export class Router {

@Event() ionRouteChanged!: EventEmitter<RouterEventDetail>;

componentWillLoad() {
async componentWillLoad() {
console.debug('[ion-router] router will load');

const tree = readRoutes(this.el);
this.routes = flattenRouterTree(tree);
this.redirects = readRedirects(this.el);

return this.writeNavStateRoot(this.getPath(), RouterDirection.None);
const changed = await this.writeNavStateRoot(this.getPath(), RouterDirection.None);
if (!changed) {
console.error('[ion-router] did not change on will load');
}
}

componentDidLoad() {
Expand Down

0 comments on commit e56b2ee

Please sign in to comment.