mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 16:20:44 +01:00
28 lines
677 B
JavaScript
28 lines
677 B
JavaScript
define([
|
|
'app',
|
|
'factories/playbook',
|
|
'services/playbooks',
|
|
'services/credentials'
|
|
], function(app) {
|
|
app.registerController('AddPlaybookCtrl', ['$scope', 'Playbook', 'playbooks', '$state', 'credentials', function($scope, Playbook, playbooks, $state, credentials) {
|
|
$scope.playbook = new Playbook();
|
|
|
|
credentials.getCredentials(function () {
|
|
$scope.credentials = credentials.credentials;
|
|
});
|
|
|
|
$scope.add = function () {
|
|
$scope.playbook.add()
|
|
.success(function (data) {
|
|
playbooks.getPlaybooks(function () {
|
|
$state.transitionTo('playbook.view', {
|
|
playbook_id: data._id
|
|
});
|
|
});
|
|
})
|
|
.error(function (data) {
|
|
|
|
})
|
|
}
|
|
}]);
|
|
}); |