whole_func_string: function tableDataSort(key, data, direction) {
      var dataCopy = data.map(function (i) { return Object.assign({}, i); });
      dataCopy.sort(function (a, b) {
          var sortResult;
          var aTmp = a[key];
          var bTmp = b[key];
          if (typeof aTmp === 'number' && typeof bTmp === 'number') {
              sortResult = sort(aTmp, bTmp);
          }
          else {
              sortResult = sort((aTmp + '').toLowerCase(), (bTmp + '').toLowerCase());
          }
          return sortResult * direction;
      });
      return dataCopy;
  }
func_code_string: function tableDataSort(key, data, direction) {
      var dataCopy = data.map(function (i) { return Object.assign({}, i); });
      dataCopy.sort(function (a, b) {
          var sortResult;
          var aTmp = a[key];
          var bTmp = b[key];
          if (typeof aTmp === 'number' && typeof bTmp === 'number') {
              sortResult = sort(aTmp, bTmp);
          }
          else {
              sortResult = sort((aTmp + '').toLowerCase(), (bTmp + '').toLowerCase());
          }
          return sortResult * direction;
      });
      return dataCopy;
  }
func_documentation_string: https://github.com/thelgevold/angular-2-samples