chrisfarber / ember-breadcrumbs

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

Cannot figure this out! #11

Closed mearleycf closed 9 years ago

mearleycf commented 9 years ago

I can't seem to get anything except a hard-coded value to show up for the breadcrumbs.

The artifacts.js controller: //controllers/artifacts.js import Ember from 'ember';

export default Ember.ArrayController.extend({
breadCrumb: 'name',
sortProperties: ['title'],
sortAscending: true,
filter:'',

filteredContent: function(){
  var filter = this.get('filter');
  var rx = new RegExp(filter.replace(/\W/g, ''), 'gi');
  var rules = this.get('arrangedContent');

  return rules.filter(function(rule) {
    return rx.test(rule.get('title'));
  });

}.property('arrangedContent', 'filter')
});

The handlebars template: <div class="col-xs-12 flex isRow spaceBetween alignCenter"> <div class=""><h1>{{title}}</h1></div> <div class=""> {{#link-to 'artifacts'}} <button class="btn btn-default">Back to List</button> {{/link-to}} {{#link-to 'artifacts.edit' model}} <button class="btn btn-primary">Edit</button> {{/link-to}} </div> </div>

` I can see the bread-crumbs code in the vendor.js file. I added the appropriate lines to brocfile.js and bower.json. Here is the rendered code: `` How do I replace 'name' with the actual path it's supposed to render?!?
chrisfarber commented 9 years ago

Sorry about the confusion. You might want to check out a sample app I put up here: https://github.com/chrisfarber/ember-breadcrumbs-sample-app

It includes an example of a live-updating dynamic breadcrumb.