Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : can.route replacing attributes

$
0
0
My question is a little harder. 
I made a mistake in result it should be http://localhost/bar/bar
So in default route I can not add one more attribute.

I have this routing rules in my can.Control file.
  1. ':foo route': function () {},
  2. 'bar/:bar route': function () {},
When current route state is http://localhost/foo (so current route attribute ':foo' is foo) and after that I call can.route.attr('bar', 'bar'); It became a http://localhost/foo?bar=bar, but I want http://localhost/bar/bar and I want 2 line processor work. To solve this I can manualy call: 
  1. window.history.pushState(null, null, 'http://localhost/bar/bar');
It push state and call 'bar/:bar route' callback. And it works great.

P.S.: Sorry for my bad English.

Viewing all articles
Browse latest Browse all 3491

Trending Articles