Template - dennisvintherjensen/OpenClassrooms-FED-Enhance-an-existing-project GitHub Wiki
Description
Handles templating
Properties
{string} defaultTemplate
: Default template for a task
Constructor
Template()
: Sets up defaults for all the Template methods such as a default template
Methods
show(data)
: Creates an HTML string and returns it for placement in your app.
Arguments
{object} data
: data The object containing keys you want to find in template to replace.
Returns
{string}
: HTML String of an<li>
element
itemCounter(activeTodos)
: Displays a counter of how many to dos are left to complete
Arguments
{number} activeTodos
: The number of active todos.
Returns
{string}
: String containing the count
clearCompletedButton(completedTodos)
: Updates the text within the "Clear completed" button
Arguments
{[type]} completedTodos
: The number of completed todos.
Returns
{string}
: String containing the count