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 has been archived by the owner on Sep 10, 2019. It is now read-only.
The close: FoundationApi.publish('my-notification', 'clearall');
Currently, it goes through the function, but the notification remains visible on the page. It's possible it's something on my end (again) but I did create a small patch, if others are having this issue.
(which is more performant, according to this stackoverflow post) they are removed appropriately. I've seen behavior like this before when trying to empty arrays in services, and I believe it was because setting it to an empty array creates a new object, and breaks the data binding, whereas the other two methods only modify the current object.
Also, in the very limited testing I've managed to do, this has worked sans $scope.apply().
Finally, would it be possible to add a section to the docs that explains how to close notifications programmatically? I wound up spelunking in the source to find FoundationApi.publish('my-notification', 'clearall');
The text was updated successfully, but these errors were encountered:
liamfd
changed the title
Notification Clearall not Running
Notification Clearall not Removing Notification Elements from View
Dec 16, 2014
liamfd
changed the title
Notification Clearall not Removing Notification Elements from View
Notification Clearall not Removing Elements from View
Dec 16, 2014
In addition to the $scope.apply issue detailed elsewhere, I have been having difficulty getting the notification clearall to run properly.
The notification open:
FoundationApi.publish('my-notification', { color:"alert", content: 'Bad news.', position:"top middle"});
The close:
FoundationApi.publish('my-notification', 'clearall');
Currently, it goes through the function, but the notification remains visible on the page. It's possible it's something on my end (again) but I did create a small patch, if others are having this issue.
Currently, it looks like (in
notification.js
):This does not remove the notification. However, if we change it to
Or
(which is more performant, according to this stackoverflow post) they are removed appropriately. I've seen behavior like this before when trying to empty arrays in services, and I believe it was because setting it to an empty array creates a new object, and breaks the data binding, whereas the other two methods only modify the current object.
Also, in the very limited testing I've managed to do, this has worked sans
$scope.apply()
.Finally, would it be possible to add a section to the docs that explains how to close notifications programmatically? I wound up spelunking in the source to find
FoundationApi.publish('my-notification', 'clearall');
The text was updated successfully, but these errors were encountered: