Reputation: 27399
I have a situation where the back button actually causes harm in my application and I seem to remember a solution in ember where I could have a single link-to helper not update the url (but keeping the routes /link-to helpers for other routes working as usual).
Is this still an option/possible in ember 1.11? If so - how? If no - what other options do I have if I need to prevent a single link-to from allowing the user to go back?
{{#link-to "foo.bar" bar}}details{{/link-to}}
Upvotes: 2
Views: 760
Reputation: 47367
Unfortunately the link-to
helper doesn't pass the replace
property down to the view itself, the LinkView
does have a property replace
which will replace the current route in history instead of just adding it to the history.
Use an action instead of a link-to
, and use this.replaceRoute
/this.replaceWith
instead of this.transition...
.
Extend the LinkView
and set replace: true
, dupe the link-to
helper code and call it link-to-replace
and use your extended LinkView
.
Upvotes: 1