Make TransactionService a bit more convenient for single-device use cases.

This commit is contained in:
Simo Kinnunen
2014-03-27 12:03:21 +09:00
parent c945a460e7
commit c0dbba8471
4 changed files with 64 additions and 26 deletions

View File

@@ -15,14 +15,14 @@ module.exports = function DeviceControlCtrl(
return $scope.control.install($files)
.then(function(tx) {
return tx.promise
.progressed(function(results) {
.progressed(function(result) {
$scope.$apply(function() {
$scope.installation = results[0]
$scope.installation = result
})
})
.then(function(results) {
.then(function(result) {
$scope.$apply(function() {
$scope.installation = results[0]
$scope.installation = result
})
})
})
@@ -34,7 +34,7 @@ module.exports = function DeviceControlCtrl(
})
.then(function(device) {
$scope.device = device
$scope.control = ControlService.forOne(device, device.channel)
$scope.control = ControlService.create(device, device.channel)
return device
})
.catch(function() {