mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 17:01:57 +00:00
35 lines
1.5 KiB
JavaScript
35 lines
1.5 KiB
JavaScript
(function(module) {
|
|
mifosX.controllers = _.extend(module, {
|
|
ViewCodeController: function(scope, routeParams , resourceFactory, location,$modal ) {
|
|
scope.codevalues = [];
|
|
resourceFactory.codeResources.get({codeId: routeParams.id} , function(data) {
|
|
scope.code = data;
|
|
});
|
|
resourceFactory.codeValueResource.getAllCodeValues({codeId: routeParams.id} , function(data) {
|
|
scope.codevalues = data;
|
|
});
|
|
scope.delCode = function (){
|
|
$modal.open({
|
|
templateUrl: 'deletecode.html',
|
|
controller: CodeDeleteCtrl
|
|
});
|
|
};
|
|
var CodeDeleteCtrl = function ($scope, $modalInstance) {
|
|
$scope.delete = function () {
|
|
resourceFactory.codeResources.delete({codeId: routeParams.id},{},function(data){
|
|
location.path('/codes');
|
|
});
|
|
$modalInstance.close('delete');
|
|
};
|
|
$scope.cancel = function () {
|
|
$modalInstance.dismiss('cancel');
|
|
};
|
|
};
|
|
|
|
}
|
|
});
|
|
mifosX.ng.application.controller('ViewCodeController', ['$scope', '$routeParams','ResourceFactory','$location','$modal', mifosX.controllers.ViewCodeController]).run(function($log) {
|
|
$log.info("ViewCodeController initialized");
|
|
});
|
|
}(mifosX.controllers || {}));
|