我已经玩了几个小时打字稿了,还没有弄清楚我是如何将淘汰赛与我的模块一起导入的?
如果没有打字稿,我将需要它define(["require", "exports", "knockout" ...],function(... , ko)
,但我还没有设法让打字稿生成它。
我不知道从 jquery 到淘汰赛有什么区别,$ 工作正常,但 ko 未定义。
///<reference path="../knockoutd.d.ts" />
///<reference path="../jquery.d.ts" />
import dl = module("DataLayer");
import vm1 = module("AppBarViewModel");
import vm2 = module("Nav2ViewModelCommander");
import vm3 = module("IdentityViewModel");
export class AppViewModel {
...
}
结果是 :
define(["require", "exports", "DataLayer", "AppBarViewModel", "Nav2ViewModelCommander", "IdentityViewModel"], function(require, exports, __dl__, __vm1__, __vm2__, __vm3__) {
var dl = __dl__;
var vm1 = __vm1__;
var vm2 = __vm2__;
var vm3 = __vm3__;
更新
和///<amd-dependency path="knockout" />
define(["require", "exports", "DataLayer", "AppBarViewModel", "Nav2ViewModelCommander", "IdentityViewModel", "knockout"], function(require, exports, __dl__, __vm1__, __vm2__, __vm3__) {
var dl = __dl__;
var vm1 = __vm1__;
var vm2 = __vm2__;
var vm3 = __vm3__;