Multiple Dynamic Segments in a Single Resource in Ember.js

前端 未结 3 1673
抹茶落季
抹茶落季 2021-01-12 19:21

Is there a way to have multiple dynamic segments with a single resource? My use case is to avoid letting the user hit index routes.

Example:

this.res         


        
3条回答
  •  梦谈多话
    2021-01-12 20:01

    Just for completeness sake, the index routes aren't necessary, they are just a freebie convenience if you define them, if you don't define them it won't go to them.

    http://emberjs.jsbin.com/eMofowUQ/1/edit

    And you can define multiple slugs in a single path and go directly to it, just note you'll only have a single model for that single resource, so you'll have to deal with that.

    http://emberjs.jsbin.com/eMofowUQ/2/edit

提交回复
热议问题