“Uncaught TypeError: undefined is not a function” initializing Backbone collection

后端 未结 2 1784
深忆病人
深忆病人 2021-02-14 05:16

I have a Backbone collection something like the following:

var FooCollection = Backbone.Collection.extend({
    model:Foo,

    initialize: function (attributes,         


        
2条回答
  •  眼角桃花
    2021-02-14 05:52

    I was experiencing the same problem. My problem was I had included my Model script after Collection Script:

    
    
    

    To fix it I just had to move the Class.js up above Classes.js:

    
    
    

    Cheers

提交回复
热议问题