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

20 lines
438 B
JavaScript
Raw Normal View History

define([
'factories/identity',
'services/identities'
2016-03-18 23:03:28 +01:00
], function () {
app.registerController('AddIdentityCtrl', ['$scope', '$state', 'Identity', function($scope, $state, Identity) {
$scope.identity = new Identity();
2016-03-18 23:03:28 +01:00
$scope.add = function () {
$scope.identity.add()
.success(function (data) {
$state.transitionTo('identity.view', {
identity_id: data._id
});
})
.error(function (data) {
})
}
}]);
});