title: accessing $dirty value inside the controller
body: <p>i have routeProvider, ng-view and controller.
  Simple template with form and input. I can see $dirty value in {{form.var1.$dirty}} - it changes when i type, but how to access it in the controller code?</p>
  
  <p>html main</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="project"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Tabs&lt;/title&gt;
      &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt;
      &lt;link href="css/bootstrap.min.css" rel="stylesheet" media="screen"&gt;
      &lt;script src="js/jquery.js"&gt;&lt;/script&gt;
      &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
      &lt;script src="lib/angular/angular.js"&gt;&lt;/script&gt;
      &lt;script src="js/dirty.js"&gt;&lt;/script&gt;
      &lt;!--&lt;script src="js/tab.js"&gt;&lt;/script&gt;--&gt;
  &lt;/head&gt;&lt;body&gt;
  
              &lt;div ng-view&gt;
  
              &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>template</p>
  
  <pre><code>{{2+2}}&lt;br&gt;
  |{{var1}}|&lt;br&gt;
  |{{form.var1.$dirty}}|
  &lt;a href="" ng-click="dodo1();"&gt;check dirty&lt;/a&gt;
  &lt;form class="form-horizontal" novalidate name="form" ng-submit="submit()"&gt;
      &lt;input id="var1" name="var1"  class="input" type="text" ng-model="var1"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>js</p>
  
  <pre><code>angular.module('project',[]).
      config(function($routeProvider) {
          $routeProvider.
              when('/', {controller:Ctrl1, templateUrl:'dirty_tab.html'}).
              when('/tab1', {controller:Ctrl1, templateUrl:'dirty_tab.html'}).
              otherwise({redirectTo:'/'});
      });
  
  function Ctrl1($scope,$rootScope) {
      $scope.var1=100;
   $scope.dodo1 = function() {
      alert(form.var1.$dirty);
   }
  }
  </code></pre>
  
  <p>Alert shows me "undefined".
  How to get var1 $dirty value?</p>