Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@barneycarroll
Last active August 4, 2016 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barneycarroll/a053f561d39ce899006447100cde8238 to your computer and use it in GitHub Desktop.
Save barneycarroll/a053f561d39ce899006447100cde8238 to your computer and use it in GitHub Desktop.
breadcrumb
var m = require('mithril');
var _ = require('lodash');
breadcrumb.view = function (ctrl,array) {
return m('.breadcrumb', [
_.map(array, function (b, i) {
return m('.breadcrumb', [
m('i.material-icons', 'chevron_right'),
m('a.breadcrumb-link', {
href: b.url,
config: m.route
}, [
b.icon ? m('i.material-icons', b.icon) : '',
b.text ? m('p', b.text) : ''
]),
i < breadcrumb.array.length - 1 ?
m('i.material-icons', 'chevron_right') : ''
])
})
])
}
module.exports = breadcrumb;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment