Ionic $timeout not working on phone

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:




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.