1

Well I know this question has been asked before and already had an answer. Here it is: TheQuestion

Actually it can't work for me and I tried a lot but failed. This works fine:

<ng-repeat="item in myList | filter:item.visible=true ">

And I tried this as TheQuestion said:

$scope.myList = $filter('filter')($scope.myList, { item.visible: true});

I also tried this one:

var isOpen = function(item) {
  return item.visible == isOpen;
}
$scope.myList = $scope.myList.filter(isOpen);

Both of them cannot work for me. Did I miss something?

Here is a plunker may help. Please don't undevote it. Thanks.

2
  • 2
    After taking a look at the plunker, it seems there is something special about the type that $asArray returns. I cannot index into an element in the controller using $scope.myList[0]. So, this seems to be specific to $firebase. Commented Mar 2, 2015 at 10:56
  • I will study the API for Angularfire. Thanks. Commented Mar 3, 2015 at 6:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.