mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-23 14:25:17 +02:00
Add user service and reorganize services. Messy commit but it's a start.
This commit is contained in:
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
|
||||
])
|
||||
})
|
||||
Reference in New Issue
Block a user