javascript - ng-repeat hide rows with empty object -


i have table repeating on array of objects. within object, there nested object, so:

[     {"object1":           {"sub_obj" : {}          }      },      {"object2":           {"sub_obj" :                 {"name" : "jane"}          }      } ] 

i want ng-hide table row "sub_obj" empty. how can achieve this? tried ng-hide=!sub_obj, doesn't work.

make simple function checks length of keys in object:

$scope.isemptyobject(obj){   return !angular.isobject(obj) || !object.keys(obj).length } 

view

ng-hide="isemptyobject(item.sub_obj)" 

Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ansible warning on jinja2 braces on when -