title: AngularJS Ionic $timeout Show Minutes And seconds
body: <p>I am making a countdown app, and I want to show the minutes And seconds until the countdown is finished. Do you have any ideas?
  I did it with the <code>$interval</code>, hopefully it's even possible to do it with that :D
  I'm pretty new to AngularJS and hope someone can help Me.</p>
  
  <p>EDIT: Are you happy now? :^)</p>
  
  <p><strong><em>INDEX.html</em></strong></p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"&gt;
      &lt;title&gt;&lt;/title&gt;
  
      &lt;link href="lib/ionic/css/ionic.css" rel="stylesheet"&gt;
      &lt;link href="css/style.css" rel="stylesheet"&gt;
  
      &lt;!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
      &lt;link href="css/ionic.app.css" rel="stylesheet"&gt;
      --&gt;
  
      &lt;!-- ionic/angularjs js --&gt;
      &lt;script src="lib/ionic/js/ionic.bundle.js"&gt;&lt;/script&gt;
  
      &lt;!-- cordova script (this will be a 404 during development) --&gt;
      &lt;script src="cordova.js"&gt;&lt;/script&gt;
  
      &lt;!-- your app's js --&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body ng-app="starter"&gt;
  
      &lt;ion-pane&gt;
        &lt;ion-header-bar class="bar-assertive"&gt;
          &lt;h1 class="title"&gt;Pizza Timer&lt;/h1&gt;
        &lt;/ion-header-bar&gt;
          &lt;ion-content class="padding" ng-controller="PopupCtrl"&gt;
            &lt;div id="TimerStart"&gt;
              &lt;!-- Button To Start the Timer --&gt;
              &lt;button class="button button-full button-assertive" ng-click="timerCountdown()"&gt;Start The Timer!&lt;/button&gt;
              &lt;!-- Shows the time --&gt;
            &lt;/div&gt;
            &lt;div ng-app ng-controller="PopupCtrl"&gt;
              +++ TIMER SHOULD BE DISPLAYED HERE ++++
            &lt;/div&gt;
        &lt;/ion-content&gt;
      &lt;/ion-pane&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong><em>app.js</em></strong></p>
  
  <pre><code>    // Ionic Starter App
  
  // angular.module is a global place for creating, registering and retrieving Angular modules
  // 'starter' is the name of this angular module example (also set in a &lt;body&gt; attribute in index.html)
  // the 2nd parameter is an array of 'requires'
  var app = angular.module('starter', ['ionic'])
  
  app.controller('PopupCtrl', function($scope, $ionicPopup, $timeout) {
  
  $scope.format = 'mm:ss';
  
  var stop;
  
  
  // shows the alert when timer is finished
  $scope.showAlert = function() {
       var alertPopup = $ionicPopup.alert({
         title: 'Your Pizza Is Ready!',
         template: 'Bon Appétit!'
       });
  
       alertPopup.then(function(res) {
         console.log('Pizza Is Ready!');
       });
     };
  
  // countdown line 31 = time 
    $scope.timerCountdown = function(res){
      console.log('Timer is running!');
      var endtimer = $timeout(
        function() {
          var alertPopup = $ionicPopup.alert({
           title: 'Your Pizza Is Ready!',
           template: 'Bon Appétit!'});
        },
        2000);
    };
  });
  
  app.run(function($ionicPlatform) {
    $ionicPlatform.ready(function() {
      if(window.cordova &amp;&amp; window.cordova.plugins.Keyboard) {
        // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
        // for form inputs)
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
  
        // Don't remove this line unless you know what you are doing. It stops the viewport
        // from snapping when text inputs are focused. Ionic handles this internally for
        // a much nicer keyboard experience.
        cordova.plugins.Keyboard.disableScroll(true);
      }
      if(window.StatusBar) {
        StatusBar.styleDefault();
      }
    });
  })
  </code></pre>