Question

Can I do a complicated route (query params) with emberjs? I am still not sure if I want to go for emberjs as I have my app's routing established on backbonejs already. Just need to be sure before switching...

For instance if I use backbonejs,

routes: {
        ':module/:branch/:method?set=:setnumber&page=:pagenumber': 'renderPager'
        }

....

renderPager: function (module,branch,method,setnumber,pagenumber) {

            console.log("module => " + module);
            console.log("branch => " + branch);
            console.log("method => " + method);
            console.log("setnumber => " + setnumber);
            console.log("pagenumber => " + pagenumber);


        }

for a route like this,

#/media/image/list?set=1&page=3

then I get the answer,

module => media
branch => image
method => list
setnumber => 1
pagenumber => 3

I don't see any documents about such routing on emberjs website. and this is a warning page about query params.

Was it helpful?

Solution

Query params has just been rewritten and has just landed in canary (https://github.com/emberjs/ember.js/pull/4008). It will (probably) be in 1.4, however in my experience ember canary works mostly and if you don't mind a few bugs and a little bit of API churn it's great.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top