Given the following code, how would you call the following jQuery UI widget?
// Vendor_Module/js/name-of-widget.js
define([jquery], function ($) {
$.widget('vendor.myWidget', {
...
});
return $.vendor.myWidget;
}); (select 2)
Select one or more of the following:
-
require(['jquery', 'Vendor_Module/js/name-of-widget'], function ($, nameOfWidget) {
$('.element-selector').myWidget({...});
});
-
require(['jquery', 'Vendor_Module/js/name-of-widget'], function ($, nameOfWidget) {
nameOfWidget(...);
});
-
require(['jquery', 'Vendor_Module/js/name-of-widget'], function ($, nameOfWidget) {
$('.element-selector').nameOfWidget({...});
});
-
require(['jquery', 'Vendor_Module/js/name-of-widget'], function ($, nameOfWidget) {
myWidget(...);
});