How to run a function , after reopening the app


I am using ionic framework. here is my app.js

and so on..

and controller file

  alert("Controller runs");
      alert("hello test");

Which is working fine .

Now i have closed my app and also its background process. Now when i reopen mu app agan

i am able to see alert(“controller runs”). but not hello test . this is working fine first time

any suggestions for the same


You have to use the resume event:
Basically, you would broadcast within it to any controllers listening to this event.


@Mik378 thanks for your reply. Could you please provide sample code for broadcasting. So i can run my factory code. Also will resume event will work after closing app fully from background too