1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00
OpenSTF/res/app/device-control/device-control-controller.js
2014-03-26 16:06:49 +09:00

25 lines
544 B
JavaScript

module.exports = function DeviceControlCtrl(
$scope
, $routeParams
, $location
, DeviceService
, GroupService
, ControlService
) {
$scope.control = null
$scope.device = null
$scope.control = null
DeviceService.get($routeParams.serial, $scope)
.then(function(device) {
return GroupService.invite(device)
})
.then(function(device) {
$scope.device = device
$scope.control = ControlService.forOne(device, device.channel)
return device
})
.catch(function() {
$location.path('/')
})
}