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
.
It should be noted that since this app is based on backbone-parse-es6
there are no additional lifecycle methods
added to Backbone.View such as close
which automatically removes all listeners defined by listenTo
. Each view
must explicitly have any listeners removed before creating a new view.
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 initial displayed view based given if a user is currently logged into the app. |
Method Summary
Public Methods | ||
public |
createItem(content: string) Creates a new Item in the todos list. |
|
public |
Invokes |
|
public |
Logs out the user and shows the login view. |
|
public |
selectFilter(filter: string) Sets the app state with the new filter type and updates |
|
public |
Creates and shows a new ManageTodosView then sets a new |
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 shows the
proper view based on whether there is a current logged in user.
Public Members
Public Methods
public createItem(content: string) source
Creates a new Item in the todos list. Note the addition of user which becomes a Parse pointer and an Parse.ACL (access control list) which limits the item to be only accessible to the current user.
Params:
Name | Type | Attribute | Description |
content | string | The text for the item. |