I have an array of trades:
var trades = [
{
orders: [
{
confirmed: true
},
{
confirmed: false
}
]
}
]
I would like to use a linq-like expression in my directive expression (in this case an ng-hide): So, something like (warning: hybrid c#-angular code below):
<div ng-repeat="trade in trades">
<span ng-hide="trade.orders.any(order => !order.confirmed)">Confirmed</span>
</div>
is there any way to write the .any(order => !order.confirmed)
using javascript?
Thanks in advance.
Angular doesn't have this, but there are some libraries you can use alongside it which provide LINQ-like features, including .any()
:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With