Home Manual Reference Source Test Demo
public class | source

TodoAppController

Todo App Controller

Constructor Summary

Public Constructor
public

constructor(domSelector: string)

Sets up the Todo App

Member Summary

Public Members
public
public

list: *[]

Method Summary

Public Methods
public

add(description: string): void

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

remove(index: number): void

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 constructor(domSelector: string) source

Sets up the Todo App

Params:

NameTypeAttributeDescription
domSelector string

DOM Selector for app container element

Public Members

public addInput: * source

public list: *[] source

Public Methods

public add(description: string): void source

Adds a New Todo Item to the list with the description provided

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
index number

index of todo to toggle in list

Return:

void

public loadList(): void source

Method to Load the List from LocalStorage on App setup

Return:

void

public remove(index: number): void source

Removes a Todo Item from the list at a given index

Params:

NameTypeAttributeDescription
index number

to remove todo at

Return:

void

public renderList(): void source

Renders the HTML of the Todo App

Return:

void

public saveList(): void source

Method to Save the List to LocalStorage during any changes

Return:

void