var app = angular.module('myApp', [])
.controller('SampleController', function ($scope, $timeout) {
  $scope.name = 'thoughtram';

  $scope.cancel = function (e) {
    if (e.keyCode == 27) {
      $scope.userForm.userName.$rollbackViewValue();
    }
  };
});
<!DOCTYPE html>
<html ng-app="myApp">

  <head>
    <meta charset="utf-8" />
    <title>AngularJS Plunker</title>
    <script>document.write('<base href="' + document.location + '" />');</script>
    <script data-require="angular.js@1.3.x" src="https://code.angularjs.org/1.3.0/angular.js" data-semver="1.3.0"></script>
    <script src="app.js"></script>
  </head>

  <body>
    <div ng-controller="SampleController">
      <form name="userForm">
        <input type="text" name="userName"
               ng-model="name"
               ng-model-options="{ updateOn: 'blur' }"
               ng-keyup="cancel($event)" />
      </form>
    </div>
  </body>

</html>