mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-25 15:25:17 +02:00
Show socket status in the UI. Absolutely no styling yet.
This commit is contained in:
18
res/app/components/stf/socket/socket-state-directive.js
Normal file
18
res/app/components/stf/socket/socket-state-directive.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = function SocketStateDirectiveFactory(socket) {
|
||||
return {
|
||||
restrict: 'E'
|
||||
, template: require('./socket-state.jade')
|
||||
, scope: {
|
||||
}
|
||||
, link: function (scope) {
|
||||
scope.$watch(
|
||||
function() {
|
||||
return socket.state
|
||||
}
|
||||
, function(state) {
|
||||
scope.state = state
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user