Im working on a backbone project and im trying to declare a new view using the line:
var tweetCompose = new ComposeTweetView();
But i get the error Uncaught TypeError: undefined is not a function
Im pulling in ComposeTweetView like so:
define([
'jquery',
'underscore',
'backbone',
'views/cart/composeTweet'
], function($,_,Backbone,ComposeTweetView){
And the composeTweet js file looks like
define([
'jquery',
'underscore',
'backbone'
], function($,_,Backbone){
var composeTweetView = Backbone.View.extend({
el: '#tweet-compose-popup',
initialize: function () {
}
});
});
I havent been able to find whats wrong.
Add
return composeTweetView;to composeTweet js after you close varcomposeTweetView