title: angularjs $watch cannot detect change of Property in an object
body: <p>I'm setting watch for <code>$scope</code> object will not trigger <code>$watch</code> change event unless the whole value is changed</p>
  
  <p><strong>Example :</strong></p>
  
  <pre><code>//Some where in .run function i set rootScope and set $watch too.
  $rootScope.config = {date:'11/4/2015',moreValues:'etc'};
  
  //setting $watch
  $rootScope.$watch('config',function(new,old) {
  console.log('config value changed :)',new);
  });
  
  //-----&gt;Inside Controller----------
  
  //NOw THIS WILL NOT TRIGGER $watch
  $rootScope.config.date = 'another day';
  
  //Same as this, it will also not trigger $watch
  var temp = $rootScope.config;
  temp.date = 'another day';
  $rootScope.config = temp;
  
  //YET THIS WILL WORK JUST FINE :) AND WILL TRIGGER $watch
  var temp = angular.copy($rootScope.config);
  temp.date = 'another day';
  $rootScope.config = temp;
  </code></pre>
  
  <p>can someone tell me why is this behavior? is there a better way to trigger <code>$watch</code> on change of object Property?</p>