-
Notifications
You must be signed in to change notification settings - Fork 1k
/
CreateClientController.js
33 lines (30 loc) · 1.29 KB
/
CreateClientController.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function(module) {
mifosX.controllers = _.extend(module, {
CreateClientController: function(scope, resourceFactory, location) {
scope.offices = [];
scope.staffs = [];
resourceFactory.clientTemplateResource.get(function(data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
});
scope.changeOffice =function(officeId) {
resourceFactory.clientTemplateResource.get({staffInSelectedOfficeOnly : false, officeId : officeId
}, function(data) {
scope.staffs = data.staffOptions;
});
}
scope.submit = function() {
this.formData.locale = 'en';
this.formData.dateFormat = 'dd MMMM yyyy';
this.formData.active = 'false';
this.formData.activationDate = '05 August 2013';
resourceFactory.clientResource.save(this.formData,function(data){
location.path('/viewclient/' + data.resourceId);
});
};
}
});
mifosX.ng.application.controller('CreateClientController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.CreateClientController]).run(function($log) {
$log.info("CreateClientController initialized");
});
}(mifosX.controllers || {}));