Open komali2 opened 5 years ago
initialize
is called at the end of the constructor function, and is passed the same arguments that you've passed to the constructor. The default implementation is to do nothing.
http://backbonejs.org/docs/backbone.html#section-51
This should, indeed, be documented slightly better.
Oh, good to know. This also clarifies a second question I had - whether attributes passed in in the constructor were available in the initialize
function. It appears they are. As in, get I do this.get('some_attribute')
inside the initialize
function.
I'm looking up how to instantiate a Backbone.Model. Under the docs for constructor / initialize, it says:
What it doesn't say is what arguments that initialize function takes, which if I remember correctly includes the
options
object passed in on instantiation.Where is this documented?