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)
Selecciona una o más de las siguientes respuestas posibles:
-
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(...);
});