chrisfarber / ember-breadcrumbs

An Ember.js component for adding breadcrumbs to your app.
MIT License
79 stars 34 forks source link

Allow arbitrary data to be attached to breadcrumb items #10

Open jessepinho opened 9 years ago

jessepinho commented 9 years ago

For my use case, I need to attach dropdowns to each breadcrumb item that link to sibling resources. To do this, I want to pass arbitrary data along with each breadcrumb's name and path, which I can then use in the template. I've simply added functionality to look for a breadCrumbData key on each controller and pass it along to the template.

davekaro commented 9 years ago

Anything holding this up? Would be useful for using icons in breadcrumb

davekaro commented 9 years ago

Actually, there is nothing stopping me right now from setting breadCrumb: { name: 'name', icon: 'whatever' } and referring to those in the template. Thanks!

jessepinho commented 9 years ago

Good point, thanks! I may start using that in my own code in the meantime.

For anyone else coming across this, note that you would have to use a custom breadcrumb template to use @davekaro's approach, since the default template treats the breadCrumb property as a string.