Skip to content

Instantly share code, notes, and snippets.

@poteto
Created June 1, 2015 22:10
Show Gist options
  • Save poteto/1751beb683521fd60ab7 to your computer and use it in GitHub Desktop.
Save poteto/1751beb683521fd60ab7 to your computer and use it in GitHub Desktop.
routeHierarchy: computed('currentRouteName', 'reverse', {
get() {
const currentRouteName = getWithDefault(this, 'currentRouteName', false);
assert('[ember-crumbly] Could not find a curent route', currentRouteName);
const routeNames = this._splitCurrentRouteName(currentRouteName);
const filteredRouteNames = this._filterIndexRoutes(routeNames);
const crumbs = this._lookupBreadCrumb(routeNames, filteredRouteNames);
return this.get('reverse') ? crumbs.reverse() : crumbs;
},
set() {
warn('[ember-crumbly] `routeHierarchy` is read only');
}
}),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment