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

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

  <meta charset="utf-8" />
  <title>AngularJs digest method</title>
  <script src=""></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.

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

/* Put your css in here */