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>
The
{{link-to}}component allows you to invoke it withreplace=true, which causes it to not calltransitionTo, butreplaceWithinstead. Like this: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 adata-href-replaceattribute on the tag, kinda like we already do for ignoring links:ember-href-to/addon/href-to.js
Lines 46 to 48 in 36c2fa8
So this would look like