本文整理匯總了TypeScript中@webkit/helper/query.Query類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Query類的具體用法?TypeScript Query怎麽用?TypeScript Query使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Query類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: loadResource
export function loadResource(resource: string, callback: Function, context?: any): void {
if(logger.isTraceEnabled()) {
logger.trace("Chargement de la ressource %s".format(resource));
}
let callbackHandler = function (text: string, status: string) {
if (status == "success") {
if(logger.isDebugEnabled()) {
logger.debug("Chargement rĂŠussi de la ressource %s".format(resource));
}
if (callback) {
callback.call(context || this, text)
}
} else {
logger.error("Erreur lors du chargement de la ressource %s".format(resource));
}
}
if(!((resource || "").toLowerCase().startsWith('http'))) {
resource = app.servicesPath + resource;
}
Query.GET(resource, callback, context, { silent: true, upToDate: false });
}
示例2: list
/**
* Execute a GET request
*/
public list(fnDone?: Function, fnFail?: Function, opts?: IQueryOptions): void {
Query.GET(this.uri, { success: fnDone, fail: fnFail }, this, opts);
}
示例3: remove
/**
* Execute a DELETE request
*/
public remove(fnDone?: Function, fnFail?: Function, opts?: IQueryOptions): void {
Query.DELETE(this.uri + "/" + this.id, { success: fnDone, fail: fnFail }, this, opts);
}
示例4: patch
/**
* Execute a PATCH request
*/
public patch(fnDone?: Function, fnFail?: Function, opts?: IQueryOptions): void {
Query.PATCH(this.uri + "/" + this.id, this.toJson(), { success: fnDone, fail: fnFail }, this, opts);
}
示例5: create
/**
* Execute a POST request
*/
public create(fnDone?: Function, fnFail?: Function, opts?: IQueryOptions): void {
Query.POST(this.uri, this.toJson(), { success: fnDone, fail: fnFail }, this, opts);
}