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?