0
votes

After migrating from global-namespace-version to ember-cli (0.1.4), my code doesn't work as before. I'm watching the content property in my controller to handle the data, fetched in my route. But nothing happens, the groupedResults function isn't called.

The data is fetched successfully (Ember Inspector shows all projects), so the content property shouldn't be empty.

Router

import Ember from 'ember';
import AuthenticatedRouteMixin from 'simple-auth/mixins/authenticated-route-mixin';

export default Ember.Route.extend(AuthenticatedRouteMixin, {

  controllerName: 'organization-projects',

  model: function() {
    return this.store.find('project');
  },

  renderTemplate: function() {

    // render all projects
    this.render('organization/projects-list', {
      into: 'application'
    });

    // render toolbar
    this.render('organization/toolbar', {
      into: 'application',
      outlet: 'toolbar'
    });

  }

});

Controller

import Ember from 'ember';

export default Ember.Controller.extend({

  groupedResults: function () {

    console.log(this.get('content'));

  }.property('content.[]')

});

Are there some breaking changes that I've missed?

1
Yes I'm sure thats Javascript... have a look at Ember/Ember-CLI...Slevin

1 Answers

0
votes

Got it: changed controllerName: 'organization-projects' to controllerName: 'organization.projects'.

But I wonder why this worked in my old global-namespace-version.