I'm still new to angular, so please bear with me if this question seems trivial. I have a collection of integers in my controller and I need to filter it to only show items that meet a certain condition.
Initially, I attempted the following:
<div>{{myCollection.find(item => item === 2)}}</div>
but unfortunately, it did not work as expected. I then tried a different approach (which I'm not too fond of because I will always have just one element to display):
<div ng-repeat="item in list | filter:{item === 2}">
<div>{{item}}</div>
</div>
However, this method also failed to produce the desired outcome. You can view my attempts on JSBin here: http://jsbin.com/govovocace/1/edit?html,js,output
Does anyone have a solution to my problem? I would prefer to avoid calculating the required field in the controller and passing it to the view (if possible).