function isEmpty(value) { return angular.isUndefined(value) || value === '' || value === null || value !== value; } function sort_by(field, reverse) { var key = function (x) { return x[field]; }; reverse = [-1, 1][+!!reverse]; return function (a, b) { return a = key(a), b = key(b), reverse * ((a > b) - (b > a)); } }I want to be able to use them from different controllers. The question is - where exactly should I put them to be able to call from my controllers?
(function () { 'use strict'; var app = angular.module('sysMgrApp', ['ui.router', 'ngSanitize', 'ngAnimate', 'toastr', 'ngCookies', 'ui.bootstrap', 'ui.sortable', 'ngDragDrop', 'colorpicker.module', 'ui.ace', 'resourceModule', 'ngFileUpload', 'ui.bootstrap.datetimepicker', 'ngMessages', 'ui.grid', 'spinnerService']); // here I tried to put these two functionsbut this didn't work - my controller was unable to find them.