1

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?

1 Answer 1

2

With dart:js :

var obj = js.context['hterm']['Terminal'];
var terminal = new js.JsObject(obj,['nike']);
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! @Alexandre! by the way, what's difference between package:js/js.dart and dart:js?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.