我有以下代码:
应用程序.js
var AgencyUI = new Marionette.Application();
AgencyUI.addRegions({
gridRegion: "#gridRegion"
});
AgencyUI.on("initialize:after", function() {
AgencyUI.trigger("grid:loadGrid");
});
grid_app.js
AgencyUI.module('GridApp', function(GridApp, AgencyUI, Backbone, Marionette, $, _) {
var API = {
loadGrid: function(dateRange) {
GridApp.Show.Controller.loadGrid(dateRange);
}
};
AgencyUI.on("grid:loadGrid", function(dateRange) {
API.loadGrid(dateRange);
});
});
show_controller.js
AgencyUI.module('GridApp.Show', function(Show, AgencyUI, Backbone, Marionette, $, _) {
Show.Controller = {
loadGrid: function(dateRange) {
// undefined
console.log($);
}
};
});
为什么 jQuery ($) 未定义?