here is my view where my search bar appears when search button is clicked.
<ion-nav-buttons side="right">
<div class="searchBar">
<div class="searchTxt" ng-show="show">
<div class="bgdiv"></div>
<div class="bgtxt">
<input type="search" placeholder="What are you looking for?" ng-change="search()" ng-model="query" >
</div>
</div>
<button class="button button-balanced button-clear" ng-click="show=!show">
<i class="ion-android-search" style="font-size: 28px; color: #fff"></i>
</button>
</div>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
When user starts type in characters inside the search bar, ng-change event gets triggered! And search() function in the controller will be executed.
$scope.search = function() {
console.log('inside search function ’ + $scope.query);
}
the scope variable “query” in the template is not getting updated in the controller. Can you @leob or @coreelements help to fix it?