title: $watch in angularJS is not working as expected
body: <p>In my controller I want to be notified when a variable value is changed. My requirement is when value of a variable will change a function will be invoked. So I am using <code>$watch</code>. My code is as follow.</p>
  
  <pre><code>var Canvas = angular.module('canvas');
  
  Canvas.controller("excelOperation",function($scope,Data,SharedData,$http){
  
      $scope.tbody=$scope.$parent.shared.previews;
  
       $scope.$watch('$parent.shared.previews',function(newVal,oldVal){
          console.log("WORKING");
       })
  
       setInterval(function(){
           console.log($scope.$parent.shared.previews);
       },1000)
  
      /**
       * Populate table function to populate excel table
       */
      $scope.populateTable=function()
      {
  
      }
  })
  </code></pre>
  
  <p><code>angular.bootstrap(document.getElementById("page"), ['canvas']);</code></p>
  
  <p>But issue is <code>$watch</code> is working only when I refresh my page. Though the <code>setInterval</code> is printing the changed value of the variable <code>$watch</code> is not being invoked.</p>
  
  <p><strong>N.B. <code>$scope.$parent.shared.previews</code> is an object</strong> </p>
  
  <p>What am I doing wrong?
  And what I told to achieve, is this a good way to do?  </p>