All transaction-based ControlService methods now return promises directly, which makes it easier to integrate with other promises, is simpler and opens up new refactoring opportunities.

This commit is contained in:
Simo Kinnunen
2014-04-15 16:56:13 +09:00
parent 4270d9589c
commit f46540e51e
5 changed files with 23 additions and 29 deletions

View File

@@ -11,10 +11,9 @@ module.exports = function ShellCtrl($scope, gettext) {
return
}
var cmd = $scope.control.shell(command)
$scope.command = ''
return cmd.promise
return $scope.control.shell(command)
.progressed(function(result) {
$scope.result = result
$scope.data = result.data.join('')