ng-repeat filter on boolean

前端 未结 5 1825
再見小時候
再見小時候 2021-02-02 05:16

I am trying to filter on a boolean value in an ng-repeat.

List of unregistered users:

    

Unregistered Users

5条回答
  •  失恋的感觉
    2021-02-02 06:02

    Create a method in the controller which returns true or false based on the logic you need and specify that function in the filter.

    Something like this:

    $scope.isRegistered = function(item) {
      return item.registered;
    };
    
    

    Unregistered Users

    {{user.name}}

提交回复
热议问题