YoroDiallo YoroDiallo - 1 year ago 71
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.

Answer Source

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?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download