javascript - show customize message when no record match with angular filter -


i have added basic functionality user can enter student name filter out records table. it works fine.

however, need enhance functionality "show message no record found when no record found"

<input type="text" ng-model="searchkeyword"> <tr ng-repeat="student in students |filter: searchkeyword"> <td style="text-align: left;" width="296;">{{student.firstname}} {{student .lastname}}</td> 

any hint please?

something following no ?

<div ng-show="!(students.length > 0)">no students found! call cops!</div> 

this conditional view. can see, display id results count not greater 0! :)

or better :

<div ng-show="!(students| filter:searchkeyword).length">no students found</div> 

ref: ng-show when array length zero


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -