-
Notifications
You must be signed in to change notification settings - Fork 13.5k
feat: noHistory Feature #3418
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
Comments
+1 This is the problem I am facing and was trying to solve without any success. Good that someone else took care to log a request. Thanks for your time. |
+1 Thanks for any help |
$ionicHistory.nextViewOptions({historyRoot: true});
$state.go('app.home'); should solve your issue. |
@calendee does @AlexYankee's approach work? |
I did this in the landing page (welcome page): $ionicHistory.clearHistory(); In the origin page (login page): $ionicHistory.clearHistory(); Regards! On Mon, Mar 30, 2015 at 8:11 PM, Perry Govier [email protected]
Christian Ochsenius Director M: (+56 9) 9489 6625 T: (+56 2) 2656 4044 Los Leones 382 ISO 9001:2008 CERTIFIED |
@perrygovier No, that actually clears the entire history. So, in scenario # 2, if the user is down about 5 levels in the app (stupid I know) and then tries to add a new contact, when they do they can't get back to home anymore because the contact's list has suddenly become the history root. |
+1 In my app, when a user create a new item, he is send in the item page, but if use the back button he is send on the create page, but I want to send him on the list page. In fact, i think some functions are missing in $ionicHistory like : remove(position); // Remove a specific entry in the history stack In other world, it would be nice if we can manage the history, so we can achieve what we want. |
+1 |
I've solved this in the interim using the following decorator:
Am I doing anything incredibly stupid here? UPDATE: It doesn't work! |
Hi, Login screen > About page > From Menu go to Login > Press hardware back button > Application Should get closed rather go to About page. Below is the code for navigation to login screen. $scope.login = function() {
$ionicHistory.nextViewOptions({
disableBack: true,
disableAnimate: true,
historyRoot: true
});
$ionicHistory.clearCache();
$ionicHistory.clearHistory();
$ionicSideMenuDelegate.toggleLeft();
$state.go('login');
}; I am using ionic rc release 4 currently. |
In the mean time, here's something that worked for me:
This will update the current history entry to the new state you're navigating to, and won't create a new history entry for the previous state. See the ui-router docs here for details: http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state |
+1 |
+1, I came across scenario 1 in my app. I too have been trying the clear cache, clear history, disable back and history root stuff. Leads to subtle bugs 2-3 views down in the stack. It would be nice to have a noHistory feature. Will try @lewisl9029's suggestion, seems clean and interesting. |
Hello all! Since we are not planning on adding any additional features to Ionic 1 I am going to go ahead and close this issue for now. Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Type: feat
Platform: all
There are quite a few issues related to overcoming the back view in some apps. Most of the have been closed. I'll try to make a use case as clear as possible.
Scenario 1:
Scenario 2;
Scenario # 2 is especially contrived - but it happens. Now, you may be thinking, just do the forms in a modal! Good idea. But in some cases, designers/UX/client doesn't want a modal.
Feature Request:
In the router, be able to add a property like
avoidHistory
ornoHistory
. This would indicate that the view in question should never be added to the history stack. This way, after login in, the user will simply go back to the home page.Right now, people are trying all kinds of ways to prevent the previous view being in their history stack. This feature would solve many of those problems.
FYI : Tried adding this to Trello but doesn't seem possible.
The text was updated successfully, but these errors were encountered: