mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 16:20:44 +01:00
0f180756ab
- Restructuring & co
29 lines
705 B
JavaScript
29 lines
705 B
JavaScript
define([
|
|
'factories/playbook',
|
|
'services/playbooks',
|
|
'services/identities'
|
|
], function () {
|
|
app.registerController('EditPlaybookCtrl', ['$scope', 'playbook', 'playbooks', '$state', 'identities', function($scope, playbook, playbooks, $state, identities) {
|
|
$scope.playbook = playbook;
|
|
|
|
identities.getIdentities(function () {
|
|
$scope.identities = identities.identities;
|
|
if (!$scope.$$phase) {
|
|
$scope.$digest();
|
|
}
|
|
});
|
|
|
|
$scope.add = function () {
|
|
$scope.playbook.save()
|
|
.success(function (data) {
|
|
playbooks.getPlaybooks(function () {
|
|
$state.transitionTo('playbook.view', {
|
|
playbook_id: data._id
|
|
});
|
|
});
|
|
})
|
|
.error(function (data) {
|
|
})
|
|
}
|
|
}]);
|
|
}); |