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)
Wähle eine oder mehr der folgenden:
-
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(...);
});