1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-06 12:00:08 +02:00
OpenSTF/res/app/components/stf/socket/socket-state/index.js
Gunther Brunner 334d26eb30 - Adding refresh page directive.
- Moving controller inside link function because it was not shared code anyways.
2014-03-26 14:31:35 +09:00

26 lines
816 B
JavaScript

module.exports = angular.module('stf/socket/socket-state', [
require('stf/socket').name,
require('stf/common-ui/safe-apply').name,
require('stf/common-ui/notifications').name,
require('stf/common-ui/refresh-page').name
])
.directive('socketState', require('./socket-state-directive'))
.config([
'$provide', function ($provide) {
return $provide.decorator('$rootScope', [
'$delegate', function ($delegate) {
$delegate.safeApply = function (fn) {
var phase = $delegate.$$phase
if (phase === "$apply" || phase === "$digest") {
if (fn && typeof fn === 'function') {
fn()
}
} else {
$delegate.$apply(fn)
}
}
return $delegate
}
])
}
])