Skip to content

[ionicHistory] add method to remove the back view #3811

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

Merged
merged 2 commits into from
Apr 15, 2016

Conversation

ashconnell
Copy link

solves issue #3750

Adds a method $ionicHistory.removeBackView() which removes the cached view, element, scope, and rejigs the history. I'm already using this in production in various use-cases.

This predominantly solves the issue where in most angular applications you can use $state.go('app.foo', { location: 'replace' }) except in ionic, the history is managed manually - this is the solution.

Would be good to have it part of the core!

I'm working on the method $ionicHistory.removeFromHistory(stateName/id) which we also need for our app - and the ionic community would also benefit from this going forward. Keep an eye out.

@janpio
Copy link

janpio commented Nov 21, 2015

+1

1 similar comment
@danicomas
Copy link

+1

@pesimeao
Copy link

Any progress in this PR? It would be great to include in the next version!

@alwayrun
Copy link

alwayrun commented Jan 1, 2016

+1

@NayHaPal
Copy link

+1

@danbucholtz
Copy link
Contributor

Hi @ashconnell, can you write some unit tests for this? We can't merge this without tests. Thank you for the contribution, this is great!

Thanks,
Dan

@danbucholtz danbucholtz added the needs: reply the issue needs a response from the user label Apr 12, 2016
@danbucholtz danbucholtz merged commit 678c165 into ionic-team:master Apr 15, 2016
@danbucholtz
Copy link
Contributor

I wrote a test and merged due to demand. Thank you for your contribution! We appreciate it!

Thanks,
Dan

@kmturley
Copy link

kmturley commented Jul 5, 2016

If I use the ui-router location replace, it doesn't work

 $state.go(toState.name, { location: 'replace' });

but using angular location replace does work:

 $location.path($state.href(toState.name).slice(1)).replace();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: reply the issue needs a response from the user
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants