mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Add user service and reorganize services. Messy commit but it's a start.
This commit is contained in:
parent
f9da1cb0bf
commit
7c0e04c4b4
12 changed files with 102 additions and 22 deletions
21
res/app/scripts/services/deviceService.js
Normal file
21
res/app/scripts/services/deviceService.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
define(['./module', 'oboe'], function(mod, oboe) {
|
||||
function DevicesServiceFactory($rootScope, socketService) {
|
||||
var deviceService = {
|
||||
devices: []
|
||||
}
|
||||
|
||||
oboe('/api/v1/devices')
|
||||
.node('devices[*]', function(device) {
|
||||
deviceService.devices.push(device)
|
||||
$rootScope.$digest()
|
||||
})
|
||||
|
||||
return deviceService
|
||||
}
|
||||
|
||||
mod.factory('deviceService'
|
||||
, [ '$rootScope'
|
||||
, 'socketService'
|
||||
, DevicesServiceFactory
|
||||
])
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue