Use default ember transitions for internal links
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
It would be great not to have a normal page load in `"_self"` when clicking on a link inside Ember. Currently, using linkify and clicking on a link that directs to a page in the same ember-app, reloads Ember on that page, but that loading time wouldn't be there if a normal transition was used.
Our current solution is always use `_blank` and override the click event (not my code 😒)
```javascript
click(ev) {
// Source: https://github.com/whoward/ember-twitter-clone/commit/93af68d9f504b8b8972487e6c09851d3523a3678
const href = this.$(ev.target).attr('href');
if (href) {
const parser = document.createElement('a');
parser.href = href;
if (!(parser.hostname === window.location.hostname || parser.hostname === `www.${window.location.hostname}`)) {
return;
}
ev.preventDefault();
const router = getOwner(this).lookup('router:main');
router.transitionTo(parser.pathname);
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.