You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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.
Hi,
Angular 1.2.0 deprecated and deactivated promise unwrapping by default. If you still need it you can turn it on again using $parseProvider.unwrapPromises(). However, in Angular 1.3.0 we will no more support it.
So you need to unwrap the promise in your controller...
Closing this. Please comment if I understood you wrong.
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:
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 treatvariable
with empty string as falsy.Related issues: #3969, #4005
The text was updated successfully, but these errors were encountered: