2

I am trying to perform an ng-hide when a value is either null or an empty array (in Firebug, this appears as []).

I can carry out the null via:

ng-hide="myData.Address == null"

However when i try:

ng-hide="myData.Address == null || myData.Address == []"

The value still appears.

Oam Psy
  • 8,555
  • 32
  • 93
  • 157

3 Answers3

10

Try this:

ng-hide="myData.Address == null || myData.Address.length == 0"
Amir Popovich
  • 29,350
  • 9
  • 53
  • 99
5

null and [] are both false, a shorter and cleaner way

ng-show="myData.Address"
Ahmad
  • 1,913
  • 13
  • 21
3
ng-hide="!myData.Address || !myData.Address.length"
AlwaysALearner
  • 43,759
  • 9
  • 96
  • 78