mirror of
https://github.com/Threnklyn/MinecraftChat.git
synced 2026-05-22 14:18:28 +02:00
Working connect/disconnect handlers and status indicator
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Connect Controller
|
||||
*/
|
||||
|
||||
module.exports = function($scope, socket) {
|
||||
|
||||
$scope.connected = false;
|
||||
|
||||
socket.on('bot:connect', function(data) {
|
||||
$scope.$apply(function() {
|
||||
$scope.host = data.host;
|
||||
$scope.port = data.port;
|
||||
$scope.username = data.username;
|
||||
$scope.connected = true;
|
||||
});
|
||||
});
|
||||
|
||||
socket.on('bot:disconnect', function() {
|
||||
$scope.$apply(function() {
|
||||
$scope.connected = false;
|
||||
});
|
||||
})
|
||||
|
||||
socket.on('disconnect', function() {
|
||||
$scope.$apply(function() {
|
||||
$scope.connected = false;
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user