私はbackbonejsを初めて使用します。次のエラーに直面しています
Uncaught TypeError: undefined is not a function backbone.js:26
これが私のコードです
スクリプトタグ内のindex.php
<script>
new App.Router;
Backbone.history.start();
App.contacts = new App.Collections.Contacts;
App.contacts.fetch().then(function () {
new App.Views.App({ collection: App.contacts });
});
</script>
main.js
(function ($) {
window.App = {
Models: {},
Collections: {},
Views: {},
Router: {}
};
window.vent = _.extend({}, Backbone.Events);
})(jQuery);
router.js
App.Router = Backbone.Router.extend({
routes: {
'': 'index'
},
index: function () {
console.log('index page');
}
});
collections.js
App.Collections.Contacts = Backbone.Collection.extend({
model: App.Models.Contact,
url : '/contacts'
});
models.js
App.Models.Appoinment = Backbone.Model.extend({
//validate
});
views.js
//Global App view
App.Views.App = Backbone.View.extend({
initialize: function () {
console.log(this.collection.toJSON());
}
});
私はここで何が間違っているのですか?