简体   繁体   中英

How to create a route with a dynamic value in ember

I am new to ember. If u find my question silly please dont mind.

I have a route '/lobby' which shows a different options.

when user chooses one particular option i want to create route /lobby/option_choosen(this will be the value which user chosen).

How to create route in ember in this scenario.

Please read ember guide dynamic segment part for defining routes. and for model preparing you can read dynamic model .

In router.js,

Router.map(function() {
  this.route('lobbies');
  this.route('lobby', { path: '/lobby/:lobby_id' });
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM