lundi 27 juillet 2015

reopenClass error on nested routes in ember

For some reason im getting this error:

Error while processing route: inductee Cannot read property 'reopenClass' of undefined TypeError: Cannot read property 'reopenClass' of undefined

when trying to access the route I have setup like this:

Router

this.resource('hall-of-fame', function () {
    this.resource('year', {
        path: '/:year_id'
    }, function () {
        this.resource('inductee', {
            path: '/:inductee_id'
        });
    });
});

Route

App.InducteeRoute = Ember.Route.extend({
model: function (params) {
    console.log(params);
    return $.getJSON('/api/hall-of-fame/' + params.year_id + '/' + params.inductee_id);
},
setupController: function (controller, model) {
    controller.set('applicant', model);
}
});

The link-to is passing in the year and the slug correctly but when it tries to transition to the inductee template the route shows the error above. Image of Ember inspector




Aucun commentaire:

Enregistrer un commentaire