How is "initialize" used?
Sequoia opened this issue · 1 comments
Sequoia commented
https://github.com/Microsoft/TypeScriptSamples/blob/master/todomvc/js/todos.ts#L131-L135
// Ensure that each todo created has `content`.
initialize() {
if (!this.get("content")) {
this.set({ "content": this.defaults().content });
}
}
How/where is this called? My preference for a todo example is for stuff like this to be explicit or commented-- I am looking at this repo precisely because I'm not familiar with typescript, so I'm not sure if it's a typescript thing, a backbone thing (if so why isn't it in the Backbone.Model
ts def?). Thanks!
Sequoia commented
I see it's a backbone thing but why isn't it in the Backbone.Model def?