function wrap (key) {
            return function (func) {                        
                return function () {
                    var data = cache.get(key);
                    if (angular.isDefined(data)) {
                        return data;
                    }
                    var result = func.apply(this, arguments);
                    cache.put(key, result);
                    return result;
                };
            };
        }
/*
         * Wraps a function with additional behavior that does the following:
         * 
         * 1. Checks if the result of the function call is in cache using the key
         * 2. If result is in cache, returns that cached object.
         * 3. If not in cache, execute apply on function with arguments and then store
         * result in cache using the passed in key.
         */
Wraps a function with additional behavior that does the following.

1. Checks if the result of the function call is in cache using the key
2. If result is in cache, returns that cached object.
3. If not in cache, execute apply on function with arguments and then store
result in cache using the passed in key.
Wraps a function with additional behavior that does the following . 1 . Checks if the result of the function call is in cache using the key 2 . If result is in cache returns that cached object . 3 . If not in cache execute apply on function with arguments and then store result in cache using the passed in key .
function wrap (key) {
            return function (func) {                        
                return function () {
                    var data = cache.get(key);
                    if (angular.isDefined(data)) {
                        return data;
                    }
                    var result = func.apply(this, arguments);
                    cache.put(key, result);
                    return result;
                };
            };
        }
function wrap ( key ) { return function ( func ) { return function ( ) { var data = cache . get ( key ) ; if ( angular . isDefined ( data ) ) { return data ; } var result = func . apply ( this , arguments ) ; cache . put ( key , result ) ; return result ; } ; } ; }
Wraps a function with additional behavior that does the following:
Wraps a function with additional behavior that does the following :