I have the following Input:
<input type="search" placeholder="Suche" ng-model="query">
<i ng-if="query.length > 0" ng-click="clearSearch()" class="icon ion-close"></i>
The Controller:
.controller('ListCtrl', function($scope) {
$scope.clearSearch = function () {
console.log("pressed");
$scope.query = '';
};
})
Now I press the icon and also see the “pressed” in the console. But the value in my input is not deleted with ‘’, its still there.
Whats wrong?