]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/js/ui/default/staff/services/strings.js
LP#1526185 Disable second toast on permfail
[working/Evergreen.git] / Open-ILS / web / js / ui / default / staff / services / strings.js
1 /**
2  * egStrings : service for tracking page-specific string translations.
3  *
4  * Convience functions embedded herein are prefixed with "$" to avoid
5  * collisions with string keys, which are linked directly to the 
6  * service.
7  *
8  * egStrings.A_STRING = 'hello, world {{foo}';
9  *
10  * egStrings.$replace(egStrings.A_STRING, {foo : 'bar'})
11  *
12  */
13
14 angular.module('egCoreMod').factory('egStrings', 
15 ['$interpolate', function($interpolate) { 
16     return {
17         '$replace' : function(str, args) {
18             if (!str) return '';
19             return $interpolate(str)(args);
20         }
21     } 
22 }]);