jeudi 14 mars 2019

Ember fetch data coming from same route with different dynamic segment id

I want via an action to change the dynamic segment id from the url at the same route.E.g. go from http://localhost:4200/dashboard/my_missions/3 to
http://localhost:4200/dashboard/my_missions/1. Nothing is triggered because of the same route i guess. How can i fetch the new model data with the dynamic id change ???

My rooter.js:

Router.map(function() {
  this.route('dashboard', function() {
    this.route('my_missions', {path: '/my_missions/:mission_id'});
  });
});

My route: dashboard/my_mission.js

import Ember from 'ember';

export default Ember.Route.extend({
    model: function(params) {
        this.set('missionId', params.mission_id);
        return this.modelFor('dashboard');
    },
    setupController(controller, model) {
        this._super(...arguments);
...




Aucun commentaire:

Enregistrer un commentaire