3

I am trying to perform an ng-hide when a value is either null or an empty array (in Firebug, this appears as []).

I can carry out the null via:

ng-hide="myData.Address == null"

However when i try:

ng-hide="myData.Address == null || myData.Address == []"

The value still appears.

3 Answers 3

11

Try this:

ng-hide="myData.Address == null || myData.Address.length == 0"
Sign up to request clarification or add additional context in comments.

Comments

4

null and [] are both false, a shorter and cleaner way

ng-show="myData.Address"

1 Comment

2
ng-hide="!myData.Address || !myData.Address.length"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.