1

how can I get the length / size of a map in "ng-show"?

var map = { 
  "key1": "value1, 
  "key2": "value2, 
  "key3": "value2
}

UPDATE 01

<button ng-show="Object.keys(map).length>0"></button>

or

<button ng-show="_.size(angular.copy(map)>0"></button>

UPDATE 02

Issue with ngShow

where and how to set the $scope.Object = Object; ??

when I set that I got the following error:

Error: [$parse:isecobj] Referencing Object in Angular expressions is disallowed! Expression: Object.keys(selectedIdeas).length>0

Community
  • 1
  • 1
Jaxox
  • 940
  • 3
  • 13
  • 24

0 Answers0