app-route
app-route copied to clipboard
Hash as path intercepts links to paths without hash
Description
carbon-location with use-hash-as-path matches paths without hash.
<carbon-location route="{{route}}" use-hash-as-path></carbon-location>
<a href="#/view">Hash link</a><br/>
<a href="/link">No-hash link</a>
Expected outcome
I expected it to only match paths with hash with use-hash-as-path.
Workaround: url-space-regex="^#/". Not sure how that will work with query params described in 96.
Actual outcome
Empty data?
Live Demo
http://plnkr.co/edit/Cw6bzwtCmmsjuKqZNu0n?p=preview
Steps to reproduce
See demo.
Browsers Affected
- [x] Chrome
- [ ] Firefox
- [ ] Safari 9
- [ ] Safari 8
- [ ] Safari 7
- [ ] Edge
- [ ] IE 11
- [ ] IE 10
Good point! We could definitely give a better default url space regex for this use case.
We still want to match links to the current page's path but different query params, for example:
"?a=b#/foo/bar"
+1 - Ran into this today.