本文整理汇总了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;未经允许,请勿转载。 |
请发表评论