I just looked at learning AngularJS a few days ago. I have ng-repeat on an element, but I want to use ng-show somehow. This is my code now:
<p ng-repeat="(parameter,value) in object">{{parameter}}: {{value}}</p>
Which works well when an object is structured as
{"MobilePhone":null,"Email":"test@email.com","HomePhone":null}
I want to show only those elements that are not null. Sort of:
<p ng-repeat="(parameter,value) in object" ng-show={{value}}>{{parameter}}: {{value}}</p>
But I don’t understand why the value is already available for ng-show? How can I do an if check before showing
?
Thanks for any help. If I were unclear, please contact for more information.
source
share