dimanche 27 septembre 2015

Ember TypeError: unsupported content on calling controller func

So I'm pretty fresh to Ember and encountered a TypeError exception saying 'unsupported content' and was able to find very little docs/content in general regarding the cause of this in relation to Ember. What triggers this exception is attempting to call functions from my controller in a template...

routes/dashboard.js

export default Ember.Route.extend({
  model: function(params){
    return ['Chart1', 'Chart2', 'Chart3']
  },
  setupController: function(controller, charts) {
    controller.set('charts', charts);
  }
});

controllers/dashboard.js

export default Ember.ArrayController.extend({
  something: function() {
    return 'something!';
  }
});

dashboard.hbs

{{#each chart in charts}} 
  <div class='widget well'>
    {{ chart }}
  </div>
{{/each}}
{{something}} 

While the template can successfully loop over the array passed in, attempting to call the function 'something' raises the error and prevents the template from loading. Any ideas what I'm messing up here?




Aucun commentaire:

Enregistrer un commentaire