vendredi 30 novembre 2018

Is it possible to have (an undefined number of) optional segments in the Ember router?

I would like to collect extra segments from the Ember router in an array. Here is a made-up path to illustrate what I mean:

this.route('group', {path: 'group/:group_id(/:segments[])*'}, function() {

Is it possible to use a request like this:

GET /group/123/some/path/segments

And have them collected in an array?

group.id = 123
segments = ['some', 'path', 'segments']

Or is there any way to define optional segments, so I can just add many and collect them manually?




Aucun commentaire:

Enregistrer un commentaire