title: Autocomplete like Outlook using typeahead and Angularjs
body: <p>I want to create a textbox that utlise the typeahead Autocomplete of ui-angular, I want that the autocomlementation works every time I type the key ";"for example: 
  when I type "anny" in the textbox all contact email address containing "anny" appears, I select the one I want and when I type the key ";" I can again use autocomlementation.(like Outlook)... I have already created a textbox but it only works for an email address</p>
  
  <pre><code>&lt;div class="form-group" ng-class="{'has-error':NewRequest.BeneficiaryId.$invalid}"&gt;
       &lt;label for="inputEmail3" class="col-lg-2 control-label"&gt; Email:&lt;/label&gt;
       &lt;div class="col-sm-10"&gt;
           &lt;input type="text" name="BeneficiaryId" 
                  ng-model="Ticket.BeneficiaryId" placeholder="Email" 
                  typeahead="address as address.Email for address in Form.autoComplete($viewValue) | filter:$viewValue" 
                  typeahead-loading=" loadinglocations" 
                  class="form-control" required&gt;
  
           &lt;i ng-show="loadingLocations" class="glyphicon glyphicon-refresh"&gt; &lt;/i&gt;
       &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>And that's my service for autocomplete</p>
  
  <pre><code>services.service('Form', function ($http, $q, $modal) {
  this.autoComplete = function (val) {
      var deferred = $q.defer();
  
      $http.get("../api/Employee/getAutocomplet", {
          params: {sSearch: val }
      }).then(function (response) {
  
          var addresses = [];
          angular.forEach(response.data, function (item) {
              addresses.push(item);
          });
          deferred.resolve(addresses);
      });
      return deferred.promise;
  };
  </code></pre>