When frameworks try to be smart, AngularJS & Expressions

One of my colleagues just discovered this bug/feature in AngularJS. Using an ngIf on a string “no” will result in false. HTML: <div ng-app> <div ng-controller=”yesNoController”> <div ng-if=”yes”>Yes is defined, will display</div> <div ng-if=”no”>No is defined, but will not display on Angular 1.2.1</div> <div ng-if=”notDefined”>Not defined, will not display</div> </div> </div> JavaScript: function yesNoController($scope) { […]