Last active
August 29, 2015 14:14
-
-
Save yelvert/e5f18f1e3e0ddcbc4ce7 to your computer and use it in GitHub Desktop.
Aurelia Redirect Fail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Router} from 'aurelia-router' | |
export class App { | |
static inject () { return [Router] } | |
constructor (router) { | |
this.router = router | |
this.router.configure(config => { | |
config.title = "SampleApp" | |
config.map([ | |
{route: ['', 'dashboard'], moduleId: 'dashboard'}, | |
{route: 'login', 'moduleId': 'login'} | |
]) | |
}) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Redirect} from 'aurelia-router' | |
export class Dashboard { | |
static inject () { return [Parent.of(Router)] } | |
constructor (router) { | |
this.router = router | |
} | |
canActivate (params, queryString, routeConfig) { | |
console.log('dashboard can activate') | |
return true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RangeError: Maximum call stack size exceeded | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:73:29) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) | |
at addPreviousDeactivatable (http://localhost:9000/jspm_packages/github/aurelia/[email protected]/system/activation.js:77:9) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Parent} from 'aurelia-framework' | |
import {Router} from 'aurelia-router' | |
export class Login { | |
static inject () { return [Parent.of(Router)] } | |
constructor (router) { | |
this.router = router | |
} | |
login ($event) { | |
this.router.navigate('dashboard', {trigger: true}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment