StateChangeSuccess to dynamically determine View to show without animation

Continuing the discussion from Best way to show first view dynamically when starting app:

Hi @yurinondual, thanks for taking the time to post this solution. I’m just picking up Ionic and Angular for the very first time and and have come across this similar problem of wanting to check local storage to see if a user has already used the app before and directing them to different screens accordingly.

Would you be able to elaborate slightly as to where I should be placing this code section to direct the state of my app. I initially put a similar piece of conditional logic to check $localStorage in my app.js $ionicPlatform.ready function with a $state.go call but it caused the undesired effect of on app launch briefly showing the initial View before animating to my desired View. I was hoping your solution would help stop that but I’m unsure as to where I should be attempting this. Thanks

Rob.

Hello sorry for a delay, I was away for a while.

wil lcheck it out now…

$rootScope.$on('$stateChangeSuccess usually goes in app.run

Thanks @yurinondual, much appreciated !