Created
February 26, 2019 02:23
-
-
Save rtanubra/2c75d337bafd9d01f3373fac2fb528ff to your computer and use it in GitHub Desktop.
Module 7 Checkpoint 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shopping list application. Goal of this is to form: | |
For the 3 remaining user stories (add items, check/uncheck items, and delete items), plan out each function in pseudocode (plain language). | |
addItem | |
//utilize Jquery to listen to click of 'Add button' (or enter pressed while the input form is targetted) | |
//prevent default behaviour to GET or POST if we are using a form element | |
//create a new variable (nameToAdd) that will hold the string that is currently in the input form | |
//Update the global variable shopping list to append the new object | |
//object will have 3 keys, value pairs | |
//1. unique id | |
//2. name: nameToAdd | |
//3. checked : false | |
//re-render shopping list to reflect the new addition | |
check.uncheck items | |
//listen for an event where 'check-toggle' is clicked. | |
//create a new variable (target-id) to identify the item to toggle | |
//iterate through the global shopping list to locate item to update via target-id | |
//update the attribute checked of the object targetted | |
//re-render shopping list to reflect the new status of object targetted | |
delete items | |
//listen for an event where 'delete button' is clicked. | |
//create a new variable (target-id) to identify the item to delete | |
//iterate through the global shopping list to locate index of object to remove via target-id | |
//remove the object from the global shopping list | |
//re-render shopping list to reflect the new list without deleted object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment