Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling replaceWith instead of transitionTo #99

Open
buschtoens opened this issue Aug 30, 2018 · 0 comments
Open

Calling replaceWith instead of transitionTo #99

buschtoens opened this issue Aug 30, 2018 · 0 comments

Comments

@buschtoens
Copy link

The {{link-to}} component allows you to invoke it with replace=true, which causes it to not call transitionTo, but replaceWith instead. Like this:

{{#link-to "some.route" replace=true}}
  Link Text
{{/link-to}}

Would be nice, if we could do the something similar with {{href-to}}. Since the helper can't attach meta info to the <a> tag, we can't do it as a named param for the helper. Instead I propose allowing users to set a data-href-replace attribute on the tag, kinda like we already do for ignoring links:

isNotIgnored() {
return !this.target.attributes['data-href-to-ignore'];
}

So this would look like

<a href={{href-to "some.route"}} data-href-replace>
  Link Text
</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant