title: Debounce does not work in IE9
body: <p>My website currently uses a debounce directive with AngularJS v1.2.8. The debounce is fine in FF and Chrome but the delay does not happen in IE9. I have a strict requirement to support IE9 and I cannot upgrade to a newer version of Angular. What part of this code is not IE9 compatible? Or if there is a debounce directive that is already known to work in IE9 that would be greatly appreciated.</p>
  
  <p><strong>Current debounce directive :</strong></p>
  
  <pre><code>angular.module('stuff.debounce', []).directive('ngDebounce', function($timeout) {
  
  
      return {
          restrive: 'A',
          require: 'ngModel',
          priority: 99,
          link: function(scope, elm, attr, ngModelCtrl) {
              if(attr.type === 'radio' || attr.type === 'checkbox') return;
  
              elm.unbind('input');
  
              var debounce;
  
              elm.bind('input', function() {
                 $timeout.cancel(debounce);
                 debounce = $timeout( function () {
                    scope.$apply(function() {
                        ngModelCtrl.$setViewValue(elm.val());
                    }); 
                 }, attr.ngDebounce || 1000);
              });
              elm.bind('blur', function() {
                  scope.$apply(function() {
                      ngModelCtrl.$setViewValue(elm.val());
                  });
              });
          }
      };
  });
  </code></pre>