jeudi 28 juin 2018

Ember js params not passing properly

I have the routes defined in following way

this.route('league', {path: '/league'}, function () {
    this.route('matches', {path: '/'});
    this.route('create-team', {path: '/:matchId'}, function () {
        this.route('team',{path: '/team'});
    });
});

And i am trying to load all the players associated with a matchId inside team router as following

import Route from '@ember/routing/route';

export default Route.extend({
    model: function(params) {
        return this.store.query('player', {'match': params.matchId});
    }

});

The problem is that the params is empty. I tried to pass in hard values to the json query and it worked with get request but it doesn't work like this. Where am i going wrong with this ?




Aucun commentaire:

Enregistrer un commentaire