title: ng-disable a button if ng-pattern of input does not match
body: <p>I want to disable a button with ng-disable if ng-pattern of an input field does not match the regular expression. In this case the regular expression is "[0-9]". I have tried the following code:</p>
  
  <p>Index.html</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" ng-app="Filter"&gt;
    &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ASCII" /&gt;
      &lt;title&gt;Test&lt;/title&gt;
      &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="Test.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div class="ctrl" ng-controller="Ctrl"&gt;
            Text &lt;input type="text" ng-model="input_field" ng-pattern="[0-9]"&gt;&lt;br/&gt;
            &lt;button ng-disabled="input_field.$valid"&gt;Start Filter&lt;/button&gt;
        &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Test.js</p>
  
  <pre><code>Module.controller('Ctrl', function($scope){
      $scope.input_field = "Insert your Text here!";
  }
  </code></pre>
  
  <p>Unfortunately it is not working. I have tried many ways but nothing worked. Do you have any ideas how to disable the button if the pattern do not match.</p>