angularjs - Angular optional params cause "%3F" to be added to url if there is a trailing "/" -


i running weird error angular router. of routes have optional parameter , when user adds trailing / url "%3f"(asci code ?) added url @ end of optional parameter. 1 of routes behaves way written as:

when('/:classification?/package/compare', {    name: 'public-package-compare',    templateurl: '/pages/marketing/packages/compare',    controller: 'packagecomparecontroller' }) 

when visit "/us/package/compare" or "/package/compare" brought correct url

if visit "/us/package/compare/" brought "/us%3f/package/compare" not valid route(this breaks app).

i know few ways hack work wondering if there established angular way deal this. know can double routes , add ones / on end or add routeinterceptor wondering best way solve issue is. using angular version v1.3.0-rc.2 , using standard router. in advance time.

this angular issue , this pull request seemed have fixed issue.

unfortunately fix merged versions 1.3.10 , up. have upgrade angular version resolve issue.

if can't upgrade angular version, might try updating current version regex fix, although sounds bad idea.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -