1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00
OpenSTF/res/app/scripts/controllers/DeviceControlCtrl.js
2014-02-06 22:45:19 +09:00

21 lines
559 B
JavaScript

define(['./_module'], function(app) {
function DeviceControlCtrl($scope, $routeParams, deviceService, controlService) {
$scope.device = null
$scope.control = null
$scope.promiseOfDevice = deviceService.get($routeParams.serial)
.then(function(device) {
$scope.device = device
$scope.control = controlService.forChannel(device.channel)
return device
})
}
app.controller('DeviceControlCtrl'
, [ '$scope'
, '$routeParams'
, 'DeviceService'
, 'ControlService'
, DeviceControlCtrl
])
})