title: AngularJS observing div size
body: <p>I still learning how <strong>AngularJS</strong> works and I'm tackling how <code>$watch</code> works. I have this scenario that I wanted to watch the dimension of the <code>div.id="area"</code>. Since I'm watching the dimensions, I was planning to trigger a function upon any change of values (<code>clientWidth</code> and <code>clientHeight</code>).</p>
  
  <p>So far what I've got so far, as per my understanding about <code>$watch</code> is this:</p>
  
  <pre><code>$scope.browser = {
      width: document.getElementById("area").offsetWidth,
      height: document.getElementById("area").offsetHeight
  };
  console.log($scope.browser);
  $scope.$watch("browser", function(newValue, oldValue) {
      console.log("changed from: " + oldValue.width + " to " + newValue.width);
  }, true);
  </code></pre>
  
  <p>Any ideas how I could get the watch working?</p>