Thanks to visit codestin.com
Credit goes to github.com

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.

ng-hide evaluates empty strings as truthy #5691

Closed
@fmalk

Description

@fmalk

Version 1.2.0 introduced a bug in my UI where ng-hide treats a promise evaluated as an empty string as truthy. Up to version 1.0.8, ng-hide would evaluate an empty string as falsy, following Javascript logic:

"" == true
false

"" == false
true

This is a standard case IMO: a controller calls a service for logged user, server returns 204 code (no content), $http receives an empty string as data, calls promise resolve() with an empty string. The directive <div ng-hide="variable"> should treat variable with empty string as falsy.

Related issues: #3969, #4005

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions