Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49184

Input type keypress event

$
0
0

@Ckpk wrote:

Hi All,

I am try to call an event during keypress in one of the input box, but not sure how to pass the value of the input box.

This is how i do it and getting undefined in the end.

controller.js

$scope.bySearch = function(descr){
      var xhr = $http({
        method: 'post',
        url: 'http://www.webcentury.co.id/api/lists.php?descr='+descr
      });
     xhr.success(function(data){
        $scope.data = data.data;
      });
      $ionicScrollDelegate.scrollTop();
      console.log(descr);
}

sample.html

 <label class="item item-input">
         <i class="icon ion-search placeholder-icon"></i>
         <input type="text" ng-model="dash.search" placeholder="Search" ng-keypress="bySearch(dash.search)">
  </label>

What is the correct way to pass the data to angular?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>