alexcrack / alexcrack/angular-ui-notification

Firing recent events when invoke Notification on an event listener

Đang mở
#81 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
529
Fork
164
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

replay:
1. setup click event listener: **hahaha**
2. test Notification, perfectly worked
3. setup event trigger: $rootScope.$emit && notifySuccess for **hoho** click event listener
4. setup event listener:$rootScope.$on
5. click **hoho** , event fired, click **hahaha**, event fired before **Notification** launch, strange?
6. change event listener action from **alert** to **Notification**, guess what, infinite loop now!!!
7. add **destroy event listener** just after the first event action, **Notification** itself worked again!
8. SO, does Notification triggers existing events?
9. Thank you for reading.

sample code:

_controller.js_

```
$rootScope.$on('event:notify-success', function(event,data) {
notifySuccess({message: JSON.stringify(data), delay: 1000});
//$rootScope.$$listeners['event:notify-success'] = [];
});

function notifySuccess(data){
//Notification.success({message: data, delay: 1000})
alert(JSON.stringify(data));
}

$scope.hoho = function (){
$rootScope.$emit('event:notify-success', '22222222');
};

$scope.hahaha = function (){
Notification.success({message: 'test', delay: 1000})
};
```

_index.html_

```

hahaha


hoho

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.