mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
19 lines
538 B
JavaScript
19 lines
538 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(err) {
|
|
$location.path('/')
|
|
})
|
|
}
|