angular / router

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

Symbols on params #354

Open jnalcocer opened 9 years ago

jnalcocer commented 9 years ago

I'm using routeparams, the problem is when I use symbols like "%" on route params I get a bad request: GET http://run.plnkr.co/A0bw9EMLO5k81mBt/test/ABCD%$%5E%$ 400 (Bad Request) JavaScript:

function mainController($router) {
  this.noSymbols = 'ABCD';
  this.Symbols = 'ABCD%$^%$';
    $router.config([
      {
        path: '/test/:id',
        component: 'test'
      }
    ]);
}

HTML:

<body ng-app="App" ng-controller="MainController as main">
    <div>
      <a ng-link="test({id: main.Symbols})">Go link with Symbols</a>
    </div>
    <div>
      <a ng-link="test({id: main.noSymbols})">Go link without Symbols</a>
    </div>
    <div ng-viewport></div>
</body>

Here is pluker project: http://plnkr.co/edit/y8t1rM1SrvLp2CD46ZXz?p=preview Someone knows how can I make it work?