當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript qajax類代碼示例

本文整理匯總了TypeScript中qajax的典型用法代碼示例。如果您正苦於以下問題:TypeScript qajax類的具體用法?TypeScript qajax怎麽用?TypeScript qajax使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了qajax類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Qajax

 return (ex: Expression, env: Environment = {}) => {
   return Qajax({
     method: "POST",
     url: url + '?by=' + getSplitsDescription(ex),
     data: {
       version: version,
       dataCube: name,
       expression: ex.toJS(),
       timezone: env ? env.timezone : null
     }
   })
     .then(Qajax.filterSuccess)
     .then(Qajax.toJSON)
     .then(
       (res) => {
         return Dataset.fromJS(res.result);
       },
       (xhr: XMLHttpRequest): Dataset => {
         if (!xhr) return null; // This is only here to stop TS complaining
         var jsonError = JSON.parse(xhr.responseText);
         if (jsonError.action === 'reload') reload();
         throw new Error(jsonError.message || jsonError.error);
       }
     );
 };
開發者ID:djfwan,項目名稱:pivot,代碼行數:25,代碼來源:ajax.ts

示例2: Qajax

  window.onerror = (message, file, line, column, errorObject) => {
    column = column || (window.event && (window.event as any).errorCharacter);
    var stack = errorObject ? errorObject.stack : null;

    var err = {
      message,
      file,
      line,
      column,
      stack
    };

    if (typeof console !== "undefined") {
      console.log('An error has occurred. Please include the below information in the issue:');
      console.log(JSON.stringify(err));
    }

    Qajax({
      method: "POST",
      url: 'error',
      data: err
    });

    window.onerror = originalOnError; // only trigger once

    // the error can still be triggered as usual, we just wanted to know what's happening on the client side
    return false;
  };
開發者ID:RaviNK,項目名稱:pivot,代碼行數:28,代碼來源:error-monitor.ts

示例3: Qajax

 return (ex: Expression) => {
   return Qajax({
     method: "POST",
     url: url + '?by=' + getSplitsDescription(ex),
     data: {
       dataset: name,
       expression: ex.toJS()
     }
   })
     .then(Qajax.filterSuccess)
     .then(Qajax.toJSON)
     .then(
       (dataJS) => {
         return Dataset.fromJS(dataJS);
       },
       (xhr: XMLHttpRequest): Dataset => {
         throw new Error(JSON.parse(xhr.responseText).message);
       }
     );
 };
開發者ID:Ghostubborn,項目名稱:pivot,代碼行數:20,代碼來源:executors.ts

示例4: Qajax

 return (ex: Expression) => {
   return Qajax({
     method: "POST",
     url: url + '?by=' + getSplitsDescription(ex),
     data: {
       version: version,
       dataSource: name,
       expression: ex.toJS()
     }
   })
     .then(Qajax.filterSuccess)
     .then(Qajax.toJSON)
     .then(
       (dataJS) => {
         return Dataset.fromJS(dataJS);
       },
       (xhr: XMLHttpRequest): Dataset => {
         if (!xhr) return null; // This is only here to stop TS complaining
         var jsonError = JSON.parse(xhr.responseText);
         if (jsonError.action === 'reload') reload();
         throw new Error(jsonError.message);
       }
     );
 };
開發者ID:Rahul-Sindhu,項目名稱:pivot,代碼行數:24,代碼來源:ajax.ts


注:本文中的qajax類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。