mirror of
https://github.com/donl/meteor-ionic.git
synced 2026-05-27 06:18:11 -06:00
Added route= parameter as alternative to path=
Depending on what the developer is a cusomt to they may think of using route='blah.list' instead of path='blah.list' . We should be able to parse both.
This commit is contained in:
parent
fd7dca7265
commit
aceb6f75e9
1 changed files with 13 additions and 4 deletions
|
|
@ -33,7 +33,7 @@ Template.ionItem.helpers({
|
|||
},
|
||||
|
||||
isAnchor: function () {
|
||||
return !_.isUndefined(this.href) || !_.isUndefined(this.path);
|
||||
return !_.isUndefined(this.href) || !_.isUndefined(this.path) || !_.isUndefined(this.route);
|
||||
},
|
||||
|
||||
target: function () {
|
||||
|
|
@ -45,11 +45,20 @@ Template.ionItem.helpers({
|
|||
return this.href;
|
||||
}
|
||||
|
||||
if (this.path) {
|
||||
if ( this.path || this.route ) {
|
||||
var path;
|
||||
|
||||
if(this.route){
|
||||
path = this.route;
|
||||
} else {
|
||||
path = this.path;
|
||||
}
|
||||
console.log(this);
|
||||
console.log(path);
|
||||
if ( this.query || this.hash || this.data ){
|
||||
|
||||
var hash = {};
|
||||
hash.route = this.path;
|
||||
hash.route = path;
|
||||
hash.query = this.query;
|
||||
hash.hash = this.hash;
|
||||
hash.data = this.data;
|
||||
|
|
@ -62,7 +71,7 @@ Template.ionItem.helpers({
|
|||
}
|
||||
|
||||
} else {
|
||||
return Router.routes[this.path].path(Template.parentData(1));
|
||||
return Router.routes[path].path(Template.parentData(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue