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:
benstr 2015-01-16 09:57:58 -06:00
parent fd7dca7265
commit aceb6f75e9

View file

@ -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));
}
}
}