I am new to AnguarJS and there is something I don't understand about ng-show.
I have the following code: http://codepen.io/mars16/full/atGLp
When the user starts to type in the input field, I expect a colon to appear followed by whatever is typed. I have noticed that when f or n is typed in initially the colon character doesn't appear till more letters are typed in. Why is this?
The issue is that angular considers the values 'f', 'false', '0', 'n', and 'no' to be falsy! There is an open bug for this behavior. You can fix it with sza's approach, or you can also do this:
<span ng-show="!!variable.one">:</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With