code: function (res) {
        var value;
        try {
          value = JSON.parse(res);
          if (typeof value === 'undefined') {
            value = res;
          }
          if (value === 'true') {
            value = true;
          } else if (value === 'false') {
            value = false;
          } else if (parseFloat(value) === value && !angular.isObject(value)) {
            value = parseFloat(value);
          }
        } catch (e) {
          value = res;
        }
        return value;
      }
docs: Pass any type of a string from the localStorage to be parsed so it returns a usable version (like an Object)
  
  @param res -
  a string that will be parsed for type
  @return {*} - whatever the real type of stored value was