/** * Created by robin on 12/15/16. */ (function () { 'use strict'; angular.module('appSdk') .factory('AppUtilsBusiness', ['$rootScope', '$translate', function($rootScope, $translate) { 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('app.name'); }; AppUtilsBusiness.setToolbarTitle = function(title) { $rootScope.$emit('toolbar.title', {title: title}); }; AppUtilsBusiness.tr = function(id, data) { return $translate.instant(id, data); }; return AppUtilsBusiness; }]); })();