mardi 14 janvier 2020

Ember.Js Using TransitionTo Route with dynamic segment

I have an ember application (version 3.14) which I'd like to do a transition to a Route with dynamic segment

I'd like to redirect to /projects/other/2020 when user visits /projects/other I change my projects/other route so it looks like this but it throws me an error

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

export default Route.extend({

    model: function(){

    },
    redirect() {
        let year_data = {
            year: '2020'
        };
        this.transitionTo('projects.other',year_data);
    }
});

and this is how my projects route looks like in routes.js

this.route('projects', function() {
  this.route('notable',{path: '/'});
  this.route('other', function() {
    this.route('list', {path: '/:year'});
  });
});

these are the errors from google chrome console box

error screenshot




Aucun commentaire:

Enregistrer un commentaire