สำนักวิทยบริการและเทคโนโลยีสารสนเทศ (สวส.)

Office of Academic Resources and Information Technology

ionic search box with clear field

1.กำหนด input text ในแอพเพื่อไว้สำหรับป้อนข้อความในการค้นหา
<input type="text" placeholder="Search" ng-model="querysearch">
<button ng-click="querysearch = ''" class="button ion-android-close input-button button-small" ng-show="querysearch.length"></button>
2.เขียนโปรแกรมเพื่อเคลียค่าในใฟล์ App.js
 $scope.clearSearch = function() {
   $scope.querysearch = '';
 };