本文整理匯總了TypeScript中vs/base/common/winjs.base.ValueCallback類的典型用法代碼示例。如果您正苦於以下問題:TypeScript base.ValueCallback類的具體用法?TypeScript base.ValueCallback怎麽用?TypeScript base.ValueCallback使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了base.ValueCallback類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: loadModule
public loadModule(moduleId:string): TPromise<string[]> {
let cc: ValueCallback;
let ee: ErrorCallback;
let r = new TPromise<any>((c, e, p) => {
cc = c;
ee = e;
});
require([moduleId], (foreignModule) => {
this._foreignModule = foreignModule.create();
let methods: string[] = [];
for (let prop in this._foreignModule) {
if (typeof this._foreignModule[prop] === 'function') {
methods.push(prop);
}
}
cc(methods);
}, ee);
return r;
}
示例2:
require([moduleId], (foreignModule) => {
this._foreignModule = foreignModule.create();
let methods: string[] = [];
for (let prop in this._foreignModule) {
if (typeof this._foreignModule[prop] === 'function') {
methods.push(prop);
}
}
cc(methods);
}, ee);