Angular js - Show message if ng-repeat is empty

后端 未结 7 2012
别那么骄傲
别那么骄傲 2020-12-13 19:08

The following AngularJS application is working with ng-repeat and an applied filter. A certain applied filter leaves no values left. How can I display a notification?

<
7条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 19:52

    You can use ng-switch to do this.

    For example:

    `    

    'Found '{{(friends | filter:searchText).length}} friends

    No friends
    Name Phone
    {{friend.name}} {{friend.phone}}
    `

提交回复
热议问题