-1
我有此代碼並且在socket.connect
我希望能夠隱藏socket.disconnect
中顯示的警報。
我在文檔中看到$ scope方法hide
,show
和toggle
的引用,但是我怎麼能在這個例子中使用它們呢?
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
});