angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

Route parameters escape strategy in router DSL #401

Open aguerotSOVINTY opened 8 years ago

aguerotSOVINTY commented 8 years ago

Hi guys,

Suppose I setup a route config as such: { path: '/item/:id', component: 'itemDetails', as: 'item' }

and later on in my HTML I setup an nglink as such: <a ng-link="['/item', { id: item.id }]">Item details</a>

Now if item.id = 'item#1' or 'itemwhatever?isusedasid' I get in troubles because the id parameter must be escaped in order to be processed correctly.

Is it possible to transform the id parameter value before it is resolved as a url? Shouldn't parameters escaped especially when using /:id route?

Thanks in advance for your input