Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(alert): adjust check for close attribute #3864

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

  • Adjust check due to change in Angular 1.4 where the presence of attribute gives key value of undefined, causing variable to contain incorrect truthiness

This fixes #3848 in a way that does not conflict with Angular 1.3.

A Plunker with the 1.4 fix can be seen in action here.

A Plunker with the fix applied to 1.3 can be seen in action here.

@wesleycho wesleycho added this to the 0.13.1 (Performance) milestone Jun 27, 2015
@@ -1,7 +1,7 @@
angular.module('ui.bootstrap.alert', [])

.controller('AlertController', ['$scope', '$attrs', function ($scope, $attrs) {
$scope.closeable = 'close' in $attrs;
$scope.closeable = $attrs.close;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!$attrs.close might be clearer since we intend closeable to be a boolean.

@chrisirhc
Copy link
Contributor

Did a review. This looks good, small stylistic issue. This change is needed due to: https://github.com/angular/angular.js/blob/d193c3a25caa0d2c6dd149941c23163dbd062e4d/src/ng/compile.js#L2570-L2574

- Adjust check due to change in Angular 1.4 where the presence of attribute gives key value of `undefined`, causing variable to contain incorrect truthiness
@wesleycho
Copy link
Contributor Author

Alright, changed

@chrisirhc
Copy link
Contributor

LGTM

@wesleycho wesleycho closed this in 13a0354 Jul 5, 2015
@wesleycho wesleycho deleted the fix/alert-close branch July 5, 2015 04:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alert always shows close button
2 participants