为什么我会收到错误
require.js:5未捕获错误:模块名称"观看/音乐会/ ConcertView" 尚未加载上下文:_
define(function (require) {
var $ = require('jquery'),
Marionette = require('marionette'),
WrapperView = require('views/WrapperView'),
ConcertInfoAddView = require('views/concertInfo/ConcertInfoAddView'),
ConcertInfoModalView = require('views/concertInfo/ConcertInfoModalView'),
ConcertInfoWrapperView = require('views/concertInfo/table/ConcertInfoWrapperView'),
ConcertInfoCollection = require('collections/ConcertInfoCollection'),
Template = require('text!templates/concerts/concert-main.html');
var moment = require('moment');
var ConcertView = Marionette.View.extend({
initialize : function() {
this.listenTo(this.model, 'sync');
},
modelEvents : {
sync : function() {
WrapperView.showChildView('Content', this);
this.ConcertInfoModalView = new ConcertInfoModalView();
this.showChildView('createBody', new ConcertInfoAddView({concertId : this.model.get('id')}));
this.showChildView('tableConcerts', new ConcertInfoWrapperView());
this.showChildView('modalArea', this.ConcertInfoModalView);
ConcertInfoCollection.getConcertInfo(this.model.get('id'));
}
},
regions : {
'createBody' : '.create-body',
'tableConcerts' : '.table-concerts',
'modalArea' : '.modal-area'
},
template : function (ops) {
var date = ops.date;
var dateString = moment.unix(date).format("DD.MM.YYYY HH:mm:ss");
ops.date = dateString;
return _.template(Template)(ops);
},
getInfoModalView : function () {
return this.ConcertInfoModalView;
},
onRender : function () {
}
});
return ConcertView;});
其ConcertView
define(function(require) {
var _ = require('underscore');
var Backbone = require('backbone'),
Marionette = require('marionette'),
ConcertInfoModalView = require('views/concertInfo/ConcertInfoModalView'),
ConcertInfoCollection = require('collections/ConcertInfoCollection'),
ConcertView = require('views/concerts/ConcertView'),
Template = require('text!templates/concertInfo/table/concertInfo-item.html');
var bootbox = require('bootbox');
var ConcertInfoItemView = Marionette.View.extend({
tagName : 'tr',
ui : {
edit : '#editButton',
delete : '#deleteButton'
},
events : {
'click @ui.edit' : 'edit',
'click @ui.delete' : 'delete'
},
edit : function () {
var concertModalView = ConcertView.getInfoModalView();
concertModalView.setModel(this.model);
$('#concertInfo-edit').modal('show');
},
delete : function () {
var self = this;
bootbox.confirm({
size: 'small',
message: "Are you sure?",
callback: function(result){
if(result){
self.model.destroy(null, {
success : function(model, response) {
noty({
text : response.notice,
type : response.type
});
},
error : function (model, response) {
if(_.isArray(response.responseJSON.notice)){
_.each(response.responseJSON.notice, function (res) {
noty({
text : res,
type : response.responseJSON.type
});
});
}else{
noty({
text : response.responseJSON.notice,
type : response.responseJSON.type
});
}
}
});
}
}
});
},
template : function(ops) {
return _.template(Template)(ops);
}
});
return ConcertInfoItemView;});
我需要它的地方,为什么错误?
我在这里尝试不要求,并在其他文件中要求,工作正常