mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-29 06:12:31 -06:00
backbutton warns about routes that dont exist
This commit is contained in:
parent
2e8cc5f925
commit
1b18dd0c41
1 changed files with 10 additions and 2 deletions
|
|
@ -24,13 +24,21 @@ Template.ionNavBackButton.created = function () {
|
|||
Template.ionNavBackButton.rendered = function () {
|
||||
this.backUrl = null;
|
||||
|
||||
this.data = this.data || {};
|
||||
|
||||
if (this.data.href) {
|
||||
this.backUrl = this.data.href;
|
||||
this.backUrl = this.data.hRref;
|
||||
}
|
||||
|
||||
if (this.data.path) {
|
||||
this.backUrl = Router.routes[this.data.path].path(Template.parentData(1));
|
||||
backRoute = Router.routes[this.data.path]
|
||||
if (!backRoute) {
|
||||
console.warn("back to nonexistent route: ", this.data.path);
|
||||
return;
|
||||
}
|
||||
this.backUrl = backRoute.path(Template.parentData(1));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Template.ionNavBackButton.helpers({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue