<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Example - example-ng-model-cancel-update-production</title>
  

  <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.4/angular.min.js"></script>
  <script src="app.js"></script>
  

  
</head>
<body ng-app="cancel-update-example">
  <div ng-controller="CancelUpdateController">
  <p>Try typing something in each input.  See that the model only updates when you
     blur off the input.
   </p>
   <p>Now see what happens if you start typing then press the Escape key</p>

  <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
    <p>With $rollbackViewValue()</p>
    <input name="myInput1" ng-model="myValue" ng-keydown="resetWithCancel($event)"><br/>
    myValue: "{{ myValue }}"

    <p>Without $rollbackViewValue()</p>
    <input name="myInput2" ng-model="myValue" ng-keydown="resetWithoutCancel($event)"><br/>
    myValue: "{{ myValue }}"
  </form>
</div>
</body>
</html>