My intention is for a close button to appear within input
so that by clicking on it, the search query is reassembled and returns all items again and not just those of the search in question. This button should disappear as long as the user does not type again in the search field. It looks like I've done everything right, but ng-click
is not working on button
within the label
element. Look at the code:
<label class="item-input-wrapper">
<i class="icon ion-ios-search placeholder-icon"></i>
<input type="search" placeholder="Buscar por Evento" ng-model="busca.evento">
<button class="button" ng-hide="btnZerar" ng-click="zerar()">
<i class="ion-ios-close-outline"></i>
</button>
</label>
And in the controller:
$scope.zerar = function() {
$scope.btnZerar = true;
carregaEventosInicio();
};
Note: I am using the Ionic Framework. Can someone help me?