vendredi 2 janvier 2015

How to hide angular-strap $alert


I have this code and on socket.connect I want to be able to hide the alert that was shown in socket.disconnect.


I see there is a reference in the docs to $scope methods hide, show, and toggle but how can I use them in this example?



socket.on('disconnect', function () {

// Show login error message
$alert({
title: 'Connection lost.',
content: 'Please reload the page.',
placement: 'top-right',
type: 'danger',
show: true
});
});

socket.on('connect', function () {
// TODO: Check if connection alert is showing and if it is, hide it
});




Aucun commentaire:

Enregistrer un commentaire