I know it is absolutely stupid thing to ask but I'm curious is there a way do something like:
<div ng-show='this.children.length > 0'> // shown <div> </div> </div>
To add to @Josh David Miller answer, the following values are considered falsy in angular.
1)An Empty Array
2)An Empty String //Even a space is considered true
3)An Boolean with false
4)undefined
5)null
6) 0
So, David's answer can be written as,
<div ng-show="items.length"> <div ng-repeat="item in items"> <!-- ... --> </div> </div>
or even shorter,
<div ng-show="items"> <div ng-repeat="item in items"> <!-- ... --> </div> </div>
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