Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Ionic $timeout not working on phone

$
0
0

@armyneco wrote:

Hello everyone.

I have a very simple controller that has just few functions for now. It's a temporary solution, but I need to get it to work for now. It has a $timeout directive called timer that calls the stateForward function in 3 seconds, which then cancels the timer, forwards to the next view and clears the cache:

 $scope.stateForward=function(){
   $timeout.cancel($scope.timer);
   $state.go('app.newtView');
   $ionicHistory.clearCache();

};

$scope.timer=$timeout(
$scope.stateForward,
3000
);

It works fine in browsers, but when I compile it to IOS or Android the view is just stuck and nothing happens.

Any help would be appreciated. Thanks.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>