Show ng-repeat item only when value to display is not null
angularjs, javascript
Solution
This will work, and only if `value` is a truly value it will be shown:
<p ng-repeat="(parameter,value) in obj" ng-show="value">{{parameter}}: {{value}}</p>
(You can also use `ngIf` instead)
Example: http://jsfiddle.net/zqJKH/
Problem
I just stared learning AngularJS few days ago. I have a ng-repeat on an element, but I want to use ng-show with it somehow as well. This is my code now: ``` <p ng-repeat="(parameter,value) in object">{{parameter}}: {{value}}</p> ``` Which works well where object is structured as ``` {"MobilePhone":null,"Email":"test@email.com","HomePhone":null} ``` I want to show only elements that don't have null as a value. Something like: ``` <p ng-repeat="(parameter,value) in object" ng-show={{value}}>{{parameter}}: {{value}}</p> ``` But I don't see why value would be available there for ng-show already? How can I do an "If" check for value before showing ? Thanks for any help. If I was unclear, please ask for more info.