Cordova resumes application and angular $ apply () in phonegap app

I have a cordova / ionic / angularJS app. I am currently testing phonegap app on ios. This application uses web ports to receive external incoming messages. The angular utility function pushes new messages into an array and binds the array to the scope. Then I use $ rootScope. $ Apply () to propagate the change to my view, which displays this array of messages.

Everything works fine except when I pause and resume the application. In this case, any new incoming message is indeed correctly stored in the message array, however the view is not updated as I would expect from $ apply (). Leaving the view and returning to it fixes the problem. It's like reloading the view controller and calling the service resets something.

+3


source to share





All Articles