1angular.module('irk') 2 .factory('slownik', 3 function($http, Session, $q) { 4 var slownikTool = {}; 5 slownikTool._cache = {}; 6 slownikTool._promiseCache = {}; 7 8 slownikTool.get = function(typ) { 9 if(angular.isUndefined(slownikTool._cache[typ])) { 10 slownikTool._cache[typ] = []; 11 12 $http.get('REST/slownik/'+typ, {}).then( 13 function(response) { 14 for(var a in response.data) { 15 slownikTool._cache[typ].push(response.data[a]); 16 } 17 }); 18 } 19 return slownikTool._cache[typ]; 20 }; 21 22 slownikTool.getPromise = function(typ) { 23 if(angular.isUndefined(slownikTool._promiseCache[typ])) { 24 slownikTool._promiseCache[typ] = $http.get('REST/slownik/'+typ, {}).then( 25 function(response) { 26 return response.data; 27 }); 28 } 29 return slownikTool._promiseCache[typ]; 30 }; 31 32 slownikTool.clearCache = function() { 33 slownikTool._cache = {}; 34 slownikTool._promiseCache = {}; 35 }; 36 37 Session.registerObserverCallback(function() { 38 slownikTool.clearCache(); 39 }); 40 41 return slownikTool; 42 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.