var app = angular.module('plunker', []);

app.controller('MainCtrl', function($scope) {
  $scope.name = 'World';
});
<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8" />
  <title>AngularJs digest method</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.6/angular.min.js"></script>
  <script>
    var app = angular.module("myApp", []);

    app.controller("myCtrl", ["$scope", function($scope) {
      //set default datetime.
      $scope.currentDateTime = new Date();

      //update datetime.
      $scope.getUpdatedDateTime = function() {
        $scope.currentDateTime = new Date();
      }

      //Added an event listener.
      var event = document.getElementById("btnAppyToDigest");

      event.addEventListener('click', function() {
        //get dateTime
        $scope.currentDateTime = new Date();

        //The digest method is use to update date time forcefully.
        $scope.$digest();
      });
    }]);
  </script>
</head>

<body ng-app="myApp" ng-controller="myCtrl">
  <h2>AngularJs digest method</h2>
  <div>
    <div>
      <button ng-click="getUpdatedDateTime()">Click to Update DateTime</button>
      <button id="btnAppyToDigest">Click to Update DateTime forcefully.</button>
    </div>
    <div>Result : {{currentDateTime | date:'MM-dd-yyyy HH:mm:ss'}}</div>
  </div>
  <div>
    <h3>Note : The digest method is use to update DateTime (bind model properties) forcefully.</h3>
  </div>
  <div>
    <br><a href="http://www.code-sample.com/2014/09/angularjs-documentation.html">Click to know more details</a>
  </div>
</body>

</html>
/* Put your css in here */