community-app/app/scripts/controllers/organization/CreateEmployeeController.js

23 lines
853 B
JavaScript
Raw Normal View History

2013-08-19 14:19:54 +00:00
(function(module) {
mifosX.controllers = _.extend(module, {
CreateEmployeeController: function(scope, resourceFactory, location) {
scope.offices = [];
resourceFactory.officeResource.getAllOffices(function(data) {
scope.offices = data;
scope.formData = {
isLoanOfficer: true
};
});
scope.submit = function() {
resourceFactory.employeeResource.save(this.formData,function(data){
location.path('/viewemployee/' + data.resourceId);
});
};
}
});
mifosX.ng.application.controller('CreateEmployeeController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.CreateEmployeeController]).run(function($log) {
$log.info("CreateEmployeeController initialized");
});
}(mifosX.controllers || {}));