1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * Created by robin on 12/15/16.
- */
-
- (function () {
- 'use strict';
-
- angular.module('appSdk')
- .factory('AppUtilsBusiness', ['$rootScope', '$translate', 'luBusyBusiness', function($rootScope, $translate, luBusyBusiness) {
-
- var AppUtilsBusiness = {};
-
- AppUtilsBusiness.convertOrderBy = function(orderBy)
- {
- if (orderBy[0] == '-') {
- orderBy = orderBy.substr(1) + ":DESC";
- }
- else {
- orderBy = orderBy + ":ASC";
- }
- return orderBy;
- };
-
- AppUtilsBusiness.setTitle = function(title)
- {
- $rootScope.title = title + ' - ' + AppUtilsBusiness.tr('common.appName');
- };
-
- AppUtilsBusiness.setToolbarTitle = function(title)
- {
- $rootScope.$emit('toolbar.title', {title: title});
- };
-
- AppUtilsBusiness.mdTableLabels = function()
- {
- return {
- of: AppUtilsBusiness.tr('common.pagination.of'),
- page: AppUtilsBusiness.tr('common.pagination.page'),
- rowsPerPage: AppUtilsBusiness.tr('common.pagination.rowsPerPage')
- };
- };
-
- AppUtilsBusiness.cgBusy = function(luBusyGroup)
- {
- return {
- promise: luBusyBusiness.promise(luBusyGroup),
- message: AppUtilsBusiness.tr('common.busyLoading'),
- templateUrl:'views/busy-template.html'
- };
- };
-
- AppUtilsBusiness.tr = function(id, data)
- {
- return $translate.instant(id, data);
- };
-
- return AppUtilsBusiness;
- }]);
- })();
|