title: How to empty md-autocomplete text field after submit?
body: <p>I used md-autocomplete inside html form, then I wanted to set its field to empty after submitting. I tried, as shown in the snippet, to use <code>$setPristine()</code> but it didn't work. I also tried to assign the model to <code>null</code> or empty string, but also it wasn't successful.</p>
  
  <p>PS: Angularjs version I used is v1.3.15</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module("myApp", ["ngMaterial"])
  .controller("main", function($scope){
    $scope.searchString = "";
    $scope.routeToSearchPage = function (searchString, form) {
              $scope.form.$setPristine();
          };
    
      $scope.simulateQuery = false;
          $scope.isDisabled    = false;
          $scope.states        = loadAll();
          $scope.querySearch   = querySearch;
         function querySearch (query) {
              var results = query ? $scope.states.filter( createFilterFor(query) ) : $scope.states,
                  deferred;
              if ($scope.simulateQuery) {
                  deferred = $q.defer();
                  $timeout(function () { deferred.resolve( results ); }, Math.random() * 1000, false);
                  return deferred.promise;
              } else {
                  return results;
              }
          }
          function loadAll() {
              var allStates = "aaa, bbbb, cccc, bla";
              return allStates.split(/, +/g).map( function (state) {
                  return {
                      value: state.toLowerCase(),
                      display: state
                  };
              });
          }
          function createFilterFor(query) {
              var lowercaseQuery = angular.lowercase(query);
              return function filterFn(state) {
                  return (state.value.indexOf(lowercaseQuery) === 0);
              };
          }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.7/angular.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.7/angular-animate.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.7/angular-aria.js"&gt;&lt;/script&gt;
  &lt;script src="//rawgit.com/angular/bower-material/master/angular-material.js"&gt;&lt;/script&gt;
  &lt;div ng-app="myApp"&gt;
  &lt;div ng-controller="main"&gt;
  &lt;form name="form"
                               ng-submit="submit(searchString);$event.preventDefault();"&gt;
     &lt;md-autocomplete
          md-floating-label="search"
          ng-disabled="isDisabled"
          md-no-cache="noCache"
          md-selected-item="selectedItem"
          md-search-text="searchString"
          md-items="item in querySearch(searchString)"
          md-item-text="item.display"
          ng-keyup="$event.keyCode == 13 ? routeToSearchPage(searchString) : null"&gt;
        &lt;md-item-template&gt;
          &lt;span md-highlight-text="searchString" md-highlight-flags="^i"&gt;{{item.display}}&lt;/span&gt;
        &lt;/md-item-template&gt;
    &lt;/md-autocomplete&gt;
  &lt;/form&gt;
  &lt;md-button ng-click="routeToSearchPage(searchString, form)"&gt;
       &lt;md-icon class="material-icons"&gt;search&lt;/md-icon&gt;
  &lt;/md-button&gt;
  &lt;/div&gt;
   &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>