How to use widgets AMI.js

113 views Asked by At

In the example code for the widgets in AMI.js they get the WidgetsHandle from 'base/widgets/widgets.handle'. Is there a way to access the widgets when just using the AMI library without access to the whole repo? I've tried doing

var wh = new AMI.WidgetsHandle(a,b,c,d)

But it says it's not a constructor.

(The example is https://github.com/FNNDSC/ami/blob/dev/examples/widget_handle/widget_handle.js)

1

There are 1 answers

0
Nicolas On BEST ANSWER

You should use "AMI.HandleWidget" instead.

It is been exported there.

You code should look like:

const handle = new AMI.HandleWidget(...)

HTH,