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.
$asArrayreturns. I cannot index into an element in the controller using$scope.myList[0]. So, this seems to be specific to$firebase.