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

How is "initialize" used? #94

Description

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions