import TodoAppController from 'Template-WebpackFEND/src/example/todo/app.controller.js'
TodoAppController
Todo App Controller
Constructor Summary
Public Constructor | ||
public |
constructor(domSelector: string) Sets up the Todo App |
Method Summary
Public Methods | ||
public |
Adds a New Todo Item to the list with the description provided |
|
public |
handleAddTodo(): void Handler method for adding Todo to list and rerendering |
|
public |
handleRemoveTodo(index: number): void Handler method for removing a Todo from the list and rerendering |
|
public |
handleToggleTodo(index: number): void Handler when todo completion toggle is checked |
|
public |
loadList(): void Method to Load the List from LocalStorage on App setup |
|
public |
Removes a Todo Item from the list at a given index |
|
public |
renderList(): void Renders the HTML of the Todo App |
|
public |
saveList(): void Method to Save the List to LocalStorage during any changes |
Public Constructors
Public Methods
public add(description: string): void source
Adds a New Todo Item to the list with the description provided
Params:
Name | Type | Attribute | Description |
description | string | of new todo to add |
Return:
void |
public handleAddTodo(): void source
Handler method for adding Todo to list and rerendering
Return:
void |
public handleRemoveTodo(index: number): void source
Handler method for removing a Todo from the list and rerendering
Params:
Name | Type | Attribute | Description |
index | number | of the todo to remove from the list |
Return:
void |
public handleToggleTodo(index: number): void source
Handler when todo completion toggle is checked
Params:
Name | Type | Attribute | Description |
index | number | index of todo to toggle in list |
Return:
void |
public remove(index: number): void source
Removes a Todo Item from the list at a given index
Params:
Name | Type | Attribute | Description |
index | number | to remove todo at |
Return:
void |
public saveList(): void source
Method to Save the List to LocalStorage during any changes
Return:
void |