Domanda

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?

È stato utile?

Soluzione

With dart:js :

var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top