Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

How is "initialize" used? #94

Open
Sequoia opened this issue Apr 21, 2016 · 1 comment
Open

How is "initialize" used? #94

Sequoia opened this issue Apr 21, 2016 · 1 comment

Comments

@Sequoia
Copy link

Sequoia commented Apr 21, 2016

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
Copy link
Author

Sequoia commented Apr 21, 2016

I see it's a backbone thing but why isn't it in the Backbone.Model def?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant