title: how to use ng-change in angular typeahead search
body: <p>I want to search user list on key press event. I am using <code>customTemplate.js</code> for showing list, but on first key press result list is not getting displayed.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;input type="text" placeholder="Search people here..." ng-change="getMatchedUser();"  ng-model="selected" data-typeahead="user as user.name for user in searchMembers | filter:$viewValue" typeahead-on-select="onSelect($item, $model, $label)" typeahead-template-url="customTemplate.html"  /&gt; 
  
  &lt;script type="text/ng-template" id="customTemplate.html"&gt;
                  &lt;a style="cursor: pointer;"&gt;
                      &lt;div class="search-div"&gt;
                          &lt;span style="float: left;"&gt;&lt;img ng-src="&lt;?php echo base_url().UPLOAD_PROFILE ?&gt;{{match.model.imageUrl}}" width="30" class="img-circle"&gt;&lt;/span&gt;
                          &lt;div class="search-name"&gt;
                              &lt;span&gt;{{match.model.name}}&lt;/span&gt;&lt;br/&gt;
                              &lt;span ng-if="match.model.skillName.length"&gt;
                                  &lt;i class="skill"&gt;{{match.model.skillName}}&lt;/i&gt;
                              &lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div style="padding-bottom:42px;" ng-if="match.model.length == 5"&gt;
                          &lt;a href="&lt;?php echo base_url(); ?&gt;#/searchResult" style="float: left; padding: 18px 1px 5px 8px; color: black;"&gt; 
                              Show More Results
                          &lt;/a&gt;    
                      &lt;/div&gt;
                  &lt;/a&gt;
  &lt;/script&gt; 
  
  $scope.getMatchedUser = function(){
          $scope.searchValue = $scope.selected;
          $http({
              method : "POST",
              url : BASE_URL + 'getMatchedUser',
              data : $.param({"typeValue": $scope.selected}),
              headers : { 'Content-Type' : 'application/x-www-form-urlencoded'}
          }).success(function(data){ 
              if(data.status == "success"){
                  $scope.searchMembers = data.searchMembers;
              }
          });
      };
  </code></pre>