title: ionic app resume and pause
body: <p>I want my app to do something when it comes form it's background state to the active state. I understand according the cordova documentation I can do this with the code below and this is working.</p>
  
  <pre><code>// device APIs are available
  //
  function onDeviceReady() {
     document.addEventListener("resume", onResume, false);
  }
  
  // Handle the resume event
  //
     function onResume() {
  }
  </code></pre>
  
  <p>My app is build with Ionic and the downside of using the code above is that it only work outside my app module, so I can't trigger functions inside my app module. I found a few code example on how it should work inside my app module, but non of them are working. See some examples below.</p>
  
  <pre><code>$ionicPlatform.on('resume', function(){
      // rock on
  });
  </code></pre>
  
  <p>/</p>
  
  <pre><code>ionic.Platform.ready(function() {
      ionic.on('resume', function(){
          //rock on
      }, element);
  });
  </code></pre>
  
  <p>/</p>
  
  <pre><code>$ionicPlatform.ready(function () {
          document.addEventListener("deviceReady", function () {
              document.addEventListener("resume", function () {
                  $timeout(function () {
                      //rock on
                  }, 0);
              }, false);
          });
      });
  </code></pre>
  
  <p>Am I doing something wrong am I forgetting something, I hope someone can help me with this.<br>
  Thanks!!</p>