How to call a jQuery function from Dart?

dart, dart-js-interop

Solution

You can do :

main() {
  js.context.callMethod(r'$', ['.myClass'])
      .callMethod('myFunction', [new js.JsObject.jsify({'aKey': 'some value'})]);
}

Problem

This is a typical situation in jQuery: ``` $(".myClass").myFunction({ aKey: 'some value' }); ``` How do you call that using dart:js? The documentation is a bit cryptic and a similar question that I found here seems dated.

Original source

Related problems