Why ng-show doesn't work when F or N is typed

angularjs, angularjs-directive

Solution

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>

Problem

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?

Original source