ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

help - can not use regex for query params like /u1/u2?{p1}&{p2:[0-9]{1,3}} . Neither {myBool:bool}"

Open ilker-kiris opened this issue 11 years ago • 4 comments

Trying to use regex for query params, but it does not get routed.The below don't work url: "/myApp/u1/u2?{qp1}&{qp2:[0-9]{1,3}}"

also can not use 'bool' that is defined in ui router. The below don't work url: "/myApp/u1/u2?{qp1}&{qp2}&{qp3:bool}"

Is this a limitation on query params support in angularjs ui router

What I'm to do is; The value of one of the query params, contains the other query param keys in it as part of its value. For example with url definition of; url: "/myApp/u1/u2?{qp1}&{qp2}&{qp3}&{qp4}"

the url gets hits as http:/myApp/u1/u2?qp1=val1&qp2=val2&qp3=qp1%3Dval10%26qp2%3Dval20&qp4=val4

the qp3 is not parsed correctly, instead some of its value contents which contain qp2 and qp2 strings, get parsed into values of qp1 and qp2.

How can I achieve this ?

ilker-kiris avatar May 05 '15 16:05 ilker-kiris

What is it you are trying to do that you think this is the solution?

eddiemonge avatar May 06 '15 17:05 eddiemonge

@ilker-kiris ^^

eddiemonge avatar May 13 '15 19:05 eddiemonge

In version 0.2.15 state params with regex not working while in 0.2.14 all works fine. The sample state url: /games/{slug:[\w-]+}. In 0.2.14 state works, in 0.2.15 - router redirect to 'otherwise'.

dmitriynosenko avatar May 26 '15 19:05 dmitriynosenko

Seems to work in 0.3.2: http://plnkr.co/edit/JuUM1TpSTo5cjRRzHvJj?p=preview

christopherthielen avatar Dec 18 '16 20:12 christopherthielen