title: AngularJS - How do I know immediately when an input has been changed if it is debounced?
body: <p>Having a text input I want to know immediately when the user is changing the text, but also I want to use the debounce feature. This way I can, for example, disable a submit button while the user is changing the text and enable the submit button after checking the text in the debounced function.</p>
  
  <p>Is there a way to do this with pure AngularJS? Or should I use javascript/jquery?</p>
  
  <p>With this code I am only able to know when the user has changed the text after the debounce 500ms delay:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html ng-app="app"&gt;
      &lt;head&gt;
          &lt;script src="http://localhost/js/angular.min.js"&gt;&lt;/script&gt;
          &lt;script&gt;
              var app= angular.module('app',[]);
  
              app.controller('ExampleController',['$scope',function($scope){
                  $scope.changed= '';
                  $scope.change= function(){
                      $scope.changed= 'Changed!';
                  };
              }]);
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body ng-controller="ExampleController"&gt;
          &lt;div&gt;Message: &lt;input type="text" ng-model="model.message"
              ng-model-options="{debounce:500}" ng-change="change()" /&gt;
  
          &lt;div&gt;{{model.message}}&lt;/div&gt;
          &lt;div&gt;{{changed}}&lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>