title: Llive clock function in AngularJs controller
body: <p>I want display Hours,Minutes ans seconds(live), I written function using <code>$interval</code> in controller but <code>$scope</code> not updating my view.</p>
  
  <p>here is <strong>my view :</strong></p>
  
  <pre><code>&lt;div ng-controller="clockCtrl"&gt;
  {{hour}}:{{min}}:{{sec}}
  &lt;/div&gt;
  </code></pre>
  
  <p>here is <strong>my Controller :</strong></p>
  
  <pre><code>angular.module('myApp').controller('clockCtrl',function($scope,$interval){
  
  
   $interval(callAtInterval, 1000);
  });
  
  
      function callAtInterval(){
            console.log("this text is getting printed after each second");
            var today = new Date();
            h=today.getHours();
            var m = today.getMinutes();
            var s = today.getSeconds();
            $scope.hour=h;
            $scope.min=m;
            $scope.sec=s;
  
  
      }
  </code></pre>
  
  <p>The function is getting call but view is not getting updated.</p>