mirror of
https://github.com/ZwareBear/awx.git
synced 2026-05-14 05:08:36 -05:00
Added socket.io lib. Created a temporary Sockets tab for socket connection testing. Streamlined login process to use scope callbacks.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/************************************
|
||||
* Copyright (c) 2014 AnsibleWorks, Inc.
|
||||
*
|
||||
* Sockets.js
|
||||
* SocketsController- simple test of socket connection
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
function SocketsController ($scope, ClearScope, Socket) {
|
||||
|
||||
ClearScope();
|
||||
|
||||
var socket = Socket({ scope: $scope });
|
||||
socket.init(); //make the connection
|
||||
|
||||
$scope.messages = ['Stuff happened', 'message received', 'blah blah bob blah'];
|
||||
|
||||
socket.on('anything', function(data) {
|
||||
$scope.messages.push(data);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
SocketsController.$inject = [ '$scope', 'ClearScope', 'Socket'];
|
||||
Reference in New Issue
Block a user