Make ng-show work for 0 length strings ""

laggingreflex picture laggingreflex · Nov 2, 2014 · Viewed 8k times · Source

Is there a way to make ng-show work for 0 length strings ''?

Answer

rtucker88 picture rtucker88 · Nov 2, 2014

You can do something like this:

ng-show="zero.length >= 0"

If you want it only for zero length strings you can change it to:

ng-show="zero.length === 0"

Here's a plunkr: http://plnkr.co/K7DyPukQHcDyLAUw4Dua