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

后端 未结 2 1774
深忆病人
深忆病人 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:59

    In my actual code Foo was declared after FooCollection. Didn't realize that Javascript doesn't support forward declarations. [headdesk]

提交回复
热议问题