Semaphore/public/js/controllers/identity/add.js

21 lines
450 B
JavaScript
Raw Normal View History

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) {
})
}
}]);
});