To Do Lab (OOP Refactor)
Objective: Refactor your existing To Do App to use constructor functions. Feel free to reference the existing To Do App solutions to get started.
Requirements
- All todos should be created with a constructor function
- The constructor should accept
title
anddescription
- The constructor should accept
- The
ToDo
constructor should have a propertyall
all
should be an array oftoDo
's- Hint:
all
should be set directly on theToDo
constructor, NOT on new instances ofToDo
- The
ToDo
prototype should have asave
method that adds thetoDo
toToDo.all
- The
Todo
prototype should have arender
functionrender
should use underscore templates- Calling render should append the
toDo
to the page
- Submit the link to your To Do app repo in the homework submission form
- Read about Inheritance and the Prototype Chain to prepare for tomorrow morning's module and How to Start a Project to prepare for Project 0