mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 16:20:44 +01:00
21 lines
450 B
JavaScript
21 lines
450 B
JavaScript
|
define([
|
||
|
'app',
|
||
|
'factories/identity',
|
||
|
'services/identities'
|
||
|
], function(app) {
|
||
|
app.registerController('AddIdentityCtrl', ['$scope', '$state', 'Identity', function($scope, $state, Identity) {
|
||
|
$scope.identity = new Identity();
|
||
|
|
||
|
$scope.add = function () {
|
||
|
$scope.identity.add()
|
||
|
.success(function (data) {
|
||
|
$state.transitionTo('identity.view', {
|
||
|
identity_id: data._id
|
||
|
});
|
||
|
})
|
||
|
.error(function (data) {
|
||
|
|
||
|
})
|
||
|
}
|
||
|
}]);
|
||
|
});
|