mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:51:55 +00:00
24 lines
912 B
JavaScript
24 lines
912 B
JavaScript
(function (module) {
|
|
mifosX.controllers = _.extend(module, {
|
|
CenterController: function (scope, resourceFactory, paginatorService, location) {
|
|
|
|
scope.centers = [];
|
|
scope.routeTo = function (id) {
|
|
location.path('/viewcenter/' + id);
|
|
};
|
|
|
|
var fetchFunction = function (offset, limit, callback) {
|
|
resourceFactory.centerResource.get({offset: offset, limit: limit, paged: 'true',
|
|
orderBy: 'name', sortOrder: 'ASC'}, callback);
|
|
};
|
|
|
|
scope.centers = paginatorService.paginate(fetchFunction, 14);
|
|
}
|
|
});
|
|
mifosX.ng.application.controller('CenterController', ['$scope', 'ResourceFactory', 'PaginatorService', '$location', mifosX.controllers.CenterController]).run(function ($log) {
|
|
$log.info("CenterController initialized");
|
|
});
|
|
}(mifosX.controllers || {}));
|
|
|
|
|