RealTime Clock Using AngularJS

by Yubraj Pokharel

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<div ng-app="sycoApp" ng-controller="timeController">
    {{theTime}}
</div>



<script>
  var app = angular.module('sycoApp', []);
  app.controller('timeController', function($scope, $interval){
  $scope.theTime = new Date().toLocaleTimeString();
    $interval(function () {
        $scope.theTime = new Date().toLocaleTimeString();
    }, 1000);
  });
</script>