App
Provides the main entry point for the Todos app and major control functionality (the C in MVC). This control
functionality is exposed over an eventbus created by mainEventbus.js
.
While in this simple app there is only one view of the TodoList
a benefit of separating control functionality and
the TodoList
instance from a specific view is that it could be used across multiple views.
Constructor Summary
Public Constructor | ||
public |
Wires up the main eventbus, invokes the private s_INITIALIZE_ROUTE function which creates |
Member Summary
Public Members | ||
public |
Creates the only displayed view of the app. |
Method Summary
Public Methods | ||
public |
createItem(content: string) Creates a new Item in the todos list. |
|
public |
selectFilter(filter: string) Sets the app state with the new filter type and updates |
|
public |
showTodos(): * Creates and shows a new ManageTodosView then fetches the collection. |
Public Constructors
public constructor source
Wires up the main eventbus, invokes the private s_INITIALIZE_ROUTE function which creates AppRouter
and sets up
a catch all handler then invokes Backbone.history.start
with the root path and finally the constructor creates the main view..
Public Methods
public createItem(content: string) source
Creates a new Item in the todos list.
Params:
Name | Type | Attribute | Description |
content | string | The text for the item. |
public selectFilter(filter: string) source
Sets the app state with the new filter type and updates Backbone.History
.
Params:
Name | Type | Attribute | Description |
filter | string | Filter type to select. |
public showTodos(): * source
Creates and shows a new ManageTodosView then fetches the collection.
Return:
* |