title: Using $dirty in angularjs in order to check whenever a form is being edited
body: <p>I was trying to check whenever my form is being edited by writing some fields of it. I read $dirty should work for that task but I can't figure out what I'm missing here:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"&gt;&lt;/script&gt;
  &lt;body&gt;
  
  &lt;div ng-app="myApp" ng-controller="formCtrl"&gt;
    &lt;form name = "myForm" novalidate&gt;
      First Name:&lt;br&gt;
      &lt;input type="text" ng-model="user.firstName"&gt;&lt;br&gt;
      Last Name:&lt;br&gt;
      &lt;input type="text" ng-model="user.lastName"&gt;
      &lt;br&gt;&lt;br&gt;
      &lt;button ng-click="reset()"&gt;RESET&lt;/button&gt;
    &lt;/form&gt;
    &lt;p&gt; is Form dirty? {{isDirty}}&lt;p&gt;
    &lt;p&gt;form = {{user }}&lt;/p&gt;
    &lt;p&gt;master = {{master}}&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  var app = angular.module('myApp', []);
  app.controller('formCtrl', function($scope) {
      $scope.master = {firstName:"John", lastName:"Doe"};
      $scope.reset = function() {
          $scope.user = angular.copy($scope.master);
      };
      $scope.reset();
      $scope.isDirty = $scope.myForm.$dirty;
  });
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm trying to make the flag isDirty to true whenever the user modifies the form. Thanks</p>