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?

Was it helpful?

Solution

With dart:js :

var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top