With dart:js
:
var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);
Question
javascript code is..
var terminal = new hterm.Terminal('nike');
I tried to use js-interop
var obj = js.context['hterm']['Terminal'];
var terminal = obj('nike');
but the result is wrong. how to change new
keyword from javascript to dart with js-interop?
Solution
With dart:js
:
var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);