jquery ui - Require.js: Is it possible to wait multiple objects? -
let say, want load jquery.ui require.js
what object should set waiting in shim? jquery.ui? no, not true.
in case run after first line evaluated - $.ui = $.ui || {}; , no wigets loaded.
what next. have tried wait $.widget. yes, better, because of $.widget() base func loading ui part. but, $.ui.autocomplete still undefined.
hm. what wait next?
some of code require $.widget, have wait predefined widgets.
is possible force require.js wait multiple objects , run different callbacks or way?
edit: or pass multiple values modules depends? edit2: shim config :
shim: { 'moment_ru': { deps: ['moment'], init: function () { moment.lang('ru'); } }, 'knockout': { exports: 'ko' }, 'knockout_mapping': { deps: ['knockout'], exports: 'ko.mapping' }, 'jquery_ui': { deps: ['jquery' /*, 'jquery_widget'*/], exports: '$.widget' }, //'jquery_widget': { // deps: ['jquery'], // exports: '$.widget' //}, 'ya_maps': { exports: 'ymaps' }, 'searchhint': { deps: ['jquery', 'jquery_ui'], exports: '$.fn.searchhints' } }
in case have $.widget exist, $.ui.autocomplete undefined if make
'jquery_ui': { deps: ['jquery'], exports: '$.ui' },
i'm having $.widget undefined
Comments
Post a Comment