dimanche 19 août 2018

Cannot transitionTo, the error "more context objects were passed than there are dynamic segments" is incorrect

I'm using Ember 3, and I am having an issue using the Router service with dynamic segments. In my component, I use the Router Service to transitionTo a child route on a click, but I get this error:

Error: More context objects were passed than there are dynamic segments for the route: data.images.image

This is in the component js, where I use transitionTo and pass one parameter for the one dynamic segment:

router: service(),
actions: {
    navToSubpage() {
        // this.image is a single Ember Data record/object
        this.router.transitionTo('data.images.image', this.image)
    }
},

This is from my router, which has nested routes with one dynamic segment:

Router.map(function() {
  this.route('data', function() {
    this.route('images', function() {
      this.route('image', {path: '/image_id'});
    });
  });
});

What am I doing wrong? The error doesn't make sense to me in this case.




Aucun commentaire:

Enregistrer un commentaire