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

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -