javascript代码是..
var terminal = new hterm.Terminal('nike');
我尝试使用js-interop
var obj = js.context['hterm']['Terminal'];
var terminal = obj('nike');
但结果是错误的。如何使用js-interop将new
关键字从javascript更改为dart?
答案 0 :(得分:2)
使用dart:js
:
var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);