Router custom attributes

I find myself creating custom attributes for navigation. It would be really nice if a few were included in the framework by default or at the very least an officially supported plugin to do the same.

It seems silly that we all have to write the same code for navigate-to="route: home; params.bind: {}" and navigate-back.

But if this already exists, then please point me in the right direction.


The route-href attribute is provided by the framework. It’s documented here (scroll down to generating URLs). I don’t think there is one for navigating back.

1 Like

Excellent, thanks!

Yeah, a route-back would be quite nice.

You could create a Pull Request to add such a custom attribute to the aurelia core :slight_smile:

1 Like

Actually, it turns out that router-href is not what I need because it only works on anchor a tags. I need something that works on buttons or anything else clickable.

And again you could create a pull request to create a custom attribute like route-click to bind a event listener which redirects on click :slight_smile:

I can promise you that there are many users doing this with click.delegate manually.
I also would use it :wink:

I know. :wink:

Does route-navigate and route-back sound good?

Yes I think so :slight_smile: