mercredi 14 septembre 2016

Ember 2.5 Application Controller not present?

This is a very simple and probably easily resolved one.

I have created an emberjs application controller via ember generate controller application from which I want to return some basic computed properties based on the current path to higher level controllers and components. Basically, something like this:

export default Ember.Controller.extend({

    entity: Ember.computed('currentPath', () => {
        return this.get('currentPath').split('.')[0];
    })

});

Oddly enough, I cannot access these computed properties anywhere (they turn out undefined, even if I replace them with a debug string), and in the Ember Inspector's view tree, the application controller is apparently not even present:

enter image description here

I have an older Ember 1.13.0 app, where I'm using the application controller with no difficulty. Have I missed a deprecation here? Or do I need to register the application controller in a specific location?




Aucun commentaire:

Enregistrer un commentaire