Semaphore/public/js/controllers/identity/add.js
Matej Kramny 0f180756ab Auth page
- Restructuring & co
2016-03-18 22:03:28 +00:00

20 lines
438 B
JavaScript

define([
'factories/identity',
'services/identities'
], function () {
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) {
})
}
}]);
});