YoroDiallo YoroDiallo - 4 months ago 16
AngularJS Question

check param in object in ng-model

I have list with some persons, and if this person have comment field - you can edit this information in

. So I show this field when person have this field. But I have a problem, when I remove previous comment - input is hide. It's couse
person.comment = ""
, and I think it meens like false.

<input person="text" ng-show='person.comment' ng-model='person.comment'>

i try to do this thing:

ng-show='person.comment || person.comment === ""'

but perhaps exist a different way? like
comment in person
? My plnkr.


To check if an object has a key in javascript, for you, you could write:


from how do i check if an object has a key in javascript?