Semaphore/public/js/controllers/credential/add.js

21 lines
469 B
JavaScript
Raw Normal View History

define([
'app',
'factories/credential',
'services/credentials'
], function(app) {
app.registerController('AddCredentialCtrl', ['$scope', '$state', 'Credential', function($scope, $state, Credential) {
$scope.credential = new Credential();
$scope.add = function () {
$scope.credential.add()
.success(function (data) {
$state.transitionTo('credential.view', {
credential_id: data._id
});
})
.error(function (data) {
})
}
}]);
});