{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/router/issues/210","repository_url":"https://api.github.com/repos/aurelia/router","labels_url":"https://api.github.com/repos/aurelia/router/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/router/issues/210/comments","events_url":"https://api.github.com/repos/aurelia/router/issues/210/events","html_url":"https://github.com/aurelia/router/issues/210","id":105850312,"number":210,"title":"Feature: suppress handling on tagged links","user":{"login":"jbellsey","id":1831399,"avatar_url":"https://avatars.githubusercontent.com/u/1831399?v=3","gravatar_id":"","url":"https://api.github.com/users/jbellsey","html_url":"https://github.com/jbellsey","followers_url":"https://api.github.com/users/jbellsey/followers","following_url":"https://api.github.com/users/jbellsey/following{/other_user}","gists_url":"https://api.github.com/users/jbellsey/gists{/gist_id}","starred_url":"https://api.github.com/users/jbellsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbellsey/subscriptions","organizations_url":"https://api.github.com/users/jbellsey/orgs","repos_url":"https://api.github.com/users/jbellsey/repos","events_url":"https://api.github.com/users/jbellsey/events{/privacy}","received_events_url":"https://api.github.com/users/jbellsey/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aurelia/router/labels/duplicate","name":"duplicate","color":"cccccc"},{"url":"https://api.github.com/repos/aurelia/router/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-09-10T16:45:55Z","updated_at":"2016-08-24T20:57:03Z","closed_at":"2015-09-12T23:46:19Z","body":"I'm building a plugin, a wrapper library around Google's [MDL](http://getmdl.io). Like Bootstrap before it, it has a set of components, some of which use JavaScript to manage interactions.\r\n\r\nThe tab component links the tab button (`<a href=\"#panel1\">`) with the tab panel (`<section id=\"panel1\">`) by installing its own click handler. This means I can't use `click.bind` to bypass the router unless I rewrite Google's JS.\r\n\r\nUnfortunately, the Aurelia router intercepts those clicks and throws a \"route not found\" error. I suspect this would also be a problem for Bootstrap tab controls, which are structured similarly and also install a private click handler.\r\n\r\nI would like a way to indicate that a given link should not be processed by the router. \r\n\r\n#### Option 1: a custom attribute\r\nFor example, `<a href=\"#panel1\" au-router-suppress>`. \r\n\r\n#### Option 2: middleware\r\nEasy and stackable middleware processing via a handler in the router. The current handler (`mapUnknownRoutes`) is not named properly for this use case, but that's less important than the fact that it's not treated as stackable middleware. I.e., there's only one handler, which means my plugin will conflict with the application if it also installs a handler onto `mapUnknownRoutes`.\r\n\r\nThere may currently be a way to do something like `router.intercept()` in a plugin, but I'm not familiar enough with the library. That would let me look at the address (and the source element), look for a custom attribute that I install to flag this as a link to be handled internally, and either process the click or let it through to the router.\r\n\r\nI've tried `addPipelineStep`, but my handler is not called. Code below, in case I'm doing it wrong.\r\n\r\n```javascript\r\nimport {RouterConfiguration} from 'aurelia-router';\r\n\r\nexport function configure(config) {\r\n    \r\n    var routerConfig = config.container.get(RouterConfiguration);\r\n\r\n    routerConfig.addPipelineStep('my-handler', MyRouterHandler);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/aurelia/router/issues/comments/242205567","html_url":"https://github.com/aurelia/router/issues/210#issuecomment-242205567","issue_url":"https://api.github.com/repos/aurelia/router/issues/210","id":242205567,"user":{"login":"CasiOo","id":5333676,"avatar_url":"https://avatars.githubusercontent.com/u/5333676?v=3","gravatar_id":"","url":"https://api.github.com/users/CasiOo","html_url":"https://github.com/CasiOo","followers_url":"https://api.github.com/users/CasiOo/followers","following_url":"https://api.github.com/users/CasiOo/following{/other_user}","gists_url":"https://api.github.com/users/CasiOo/gists{/gist_id}","starred_url":"https://api.github.com/users/CasiOo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CasiOo/subscriptions","organizations_url":"https://api.github.com/users/CasiOo/orgs","repos_url":"https://api.github.com/users/CasiOo/repos","events_url":"https://api.github.com/users/CasiOo/events{/privacy}","received_events_url":"https://api.github.com/users/CasiOo/received_events","type":"User","site_admin":false},"created_at":"2016-08-24T20:57:03Z","updated_at":"2016-08-24T20:57:03Z","body":"@bryanrsmith Will the `DefaultLinkHandler` be overriden by the one we provide, or are they somehow chained?\r\n\r\nIf we only want to override the default routing behaviour for one anchor, it is a bit much with a custom LinkHandler?\r\nA use case could be an anchor to logout that should be doing a location refresh (to clear all data). It would probably be noticeable to first navigate to the route and then refresh `window.location.refresh()` <- not a good user experience.\r\n"}}
{"actor":{"display_login":"CasiOo"}}