Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngIf fails if interpolated value equals to 'n' or '0' #9598

@zuzusik

Description

@zuzusik

Angular 1.2.26
Chrome 38.0.2125.101 (64-bit)
Firefox 32.0.3

<div ng-app="myApp" ng-controller="myController">
    <input ng-model="myModel.value" />
    <div ng-if="myModel.value">
        My model value: {{myModel.value}}
    </div>
</div>
angular.module('myApp', [])
.controller('myController', function($scope) {
    $scope.myModel = {
        value: 'n'
    };
});

Result: no text "My model value: n" is displayed
Expected result: browser displays text "My model value: n" inside

The same result is with '0' string.

JS fiddle: http://jsfiddle.net/zuzusik/q5wwhpp8/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions