Hi guys , I want to clear text input on a page
In Category.html
<ion-view view-title="Category">
<ion-content>
<div>
<input type="text" id="txtsearch" placeholder="Search" >
</div>
</ion-content>
</ion-view>
Ok , when i type some character in input text , example “ABC”, then click tabs other, then click tab Category , text in input auto clear.I try set $ionicView.loaded in controller , but it’s not work.
.controller('CategoryCtrl', function ($scope) {
$scope.$on('$ionicView.loaded', function (e) {
document.getElementById("txtsearch").value = "";
});
})
Thank you.