@adam - thanks for the response. I’ve actually “solved” my problem by going with a modal as the “interstitial” between my app’s home screen and the main content.
Here’s my old scenario:
A single account can have multiple users. So, I use HTTP interceptors to make sure the account is actually authenticated.
However, each user in the account has a “secret pin”. Before they are allowed into their content, I need to have them enter their secret pin and make sure it was valid. So, on the home screen, they would tap their icon. They’d navigate to a secret pin screen, enter their PIN and then go into their personal views.
If they went “back”, I did not want them at the home screen again. Instead, I wanted “Back” to take them to the home screen. So, I was using setNavViews to replace the secret pin state with the home state.
LOL - Apparently, it was more of a hack than even I imagined, but it was quite useful.
Suggestions for a different implementation. Maybe Ionic could have a “don’t add this state to the history stack” option like:
With the current nightly, the ionicPopup doesn’t look that nice anymore. Especially when the popup is closed again, the animation doesn’t look that good and it just get’s removed after the backdrop has faded out. With beta 13 the hiding looked a lot better.
beta 13 - smooth show and hide transitions:
current nightly - when closing, the backdrop fades out and the popup get’s removed without transition:
What do you think of history push? I’m trying to relate it to adding the view to the history, which is literally pushing the view to the history array. The default would always be true. Any ideas what it should be called? Thanks
How can I remove a cached view from the cache and reload it again? I have a chart view based on Chart.js API and another view containing the data source. After changing the data source and going back to the chart view the chart isn’t updated. So my idea is to remove the chart view from the cache and reload it.
@flavordaaave thanks for the codepens! You’re right, there was an animation that was accidentally removed. It’s been fixed as of build 813. Thanks again for the code examples!
@Calendee@anemitoff I made a few updates to ensure the correct title is used at various times in the view’s transition lifecycle, as of build 814. If you take a look at the AnotherTitleCtrl controller in this example, each of the ways to update the title should now work (but I don’t recommend using timeouts that would fire the title update in the middle of a transition).
With your example, there are still cases where using a timeout, between specific milliseconds during the transition, may still not update correctly. However, I’d recommend updating the title using either $ionicView.beforeEnter or $ionicView.afterEnter from now on.
Use $ionicView.beforeEnter in most cases, and if the title isn’t know at this point, then at least wait to update the title after the transition has finished.
<ion-view view-title="{{ title }}">...</ion-view>
$scope.$on('$ionicView.beforeEnter', function(){
$scope.title = 'Before Enter Title!';
});
Use $ionicView.beforeEnter in most cases, and if the title
isn’t know at this point, then at least wait to update the title after
the transition has finished.
So, just to confirm, the method to wait until after the transition is to do it in the afterEnter event, right?
$ionicHistory.clearCache() is not removing all cached views.
For example, I navigate from the state 1 to 2, then from 2 to 3, and in the state 3 I clear the cache, but the state 2 still cached. When I clear the cache, I want all the views to be removed, and if a tab the back button, the previous view should be completely rebuild.
@brandyshea Thanks for the codepen! As of build 815, any nextViewOptions set by menuClose will expire. So in your example, the user wasn’t clicking an actual link to navigate to another view, but the menuClose directive was still setting options for the next view that registers (causing the issues). This should be fixed now, thanks for creating the example and describing how to replicate the issue!
@adam Thanks for the quick reply! I have upgraded my app to nightly build 817 and tested on the above codepen but I am still seeing this issue on both. I checked your commit on Github and saw that an “expire” was added to the directive, but it isn’t in build 817. I’m not sure how it gets into the nightly so I wanted to let you know. Thanks again!