alexcrack / angular-ui-notification

Angular.js service providing simple notifications using Bootstrap 3 styles with css transitions for animating
MIT License
536 stars 169 forks source link

close a notification programmatically #72

Closed vahidalvandi closed 8 years ago

vahidalvandi commented 8 years ago

hello i have no-timeout notification but after one event i need to close this , please help me how i can remove programmatically

alexcrack commented 8 years ago

Check the "demo" directory There is example:

$scope.killMessage = function() {
    Notification.warning("Message shouldn't be killed");
    var test = Notification.primary("Message should be killed...");
    Notification.info("Message shouldn't be killed");

    $timeout(function() {
        Notification.success("API Key sucessfully regenerated.");
        test.then(function(notification) {
            notification.kill();
        });
    }, 3000);
};