Вопрос

I'm moving quite a large application to Iron Router. On the client side, all unknown routes are redirected to /404. In addition, some routes are managed from the server side - for example /static, that just displays a static page via middleware. The problem is that Iron Router now intercepts all link clicks - so when I click a link to /static, the action is prevented, browser does not display the server response for that address, and user is redirected to /404 instead.

How do I prevent such behavior? Is there a way to tell Iron Router not to intercept a certain link?

Это было полезно?

Решение

You can tell iron router which links it should hook into with the css selector:

IronLocation.configure({
    'linkSelector' : 'a[href], a:not([skipir])'
});

Then you could have <a href=".." skipir>Skip this route</a>

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top