 <p><strong>sample.html</strong></p> <pre><code>&lt;div ng-controller="SearchCtrl"&gt; &lt;label class="item item-input"&gt; &lt;i class="icon ion-search placeholder-icon"&gt;&lt;/i&gt; &lt;input type="text" ng-model="dash.search" placeholder="Search" ng-change="bySearch(dash.search)"&gt; &lt;/label&gt; &lt;/div&gt; </code></pre> <p><strong>controller.js</strong></p> <pre><code>var routerApp = angular.module('routerApp', ['ui.router', 'ngRoute']); routerApp.controller('SearchCtrl', function($scope, $http) { $scope.bySearch = function(descr){ alert("Inside bySearch--"+descr); var xhr = $http({ method: 'post', url: 'http://mywebsite.com/api/lists.php?descr='+descr }); xhr.success(function(data){ $scope.data = data.data; }); $ionicScrollDelegate.scrollTop(); console.log(descr); } }); </code></pre> <p>This will fire bySearch() function for each key press.</p> <p>ng-keypress happens as the key is pressed, and BEFORE the value populates the input. This is why you're not getting any value on the first keypress, but on subsequent presses you will get the value.</p> <p><strong>You can also use ng-keyup</strong></p> <pre><code>&lt;input type="text" ng-model="dash.search" placeholder="Search" ng-keyup="bySearch(dash.search)"&gt; </code></pre>