new Application()
Skull.Application is very basic sample of application. It does several things:
- creates registry and registers itself as
'app'
- detects domain and other passes URL to
UrlProvider
- instantiates syncer
- instantiates router
- Detects if debug mode is on
- renders root view and starts Backbone.history, if
autostart
option passed
App dispatches route changes. Bind to path
event to handle them.
Extends
Methods
(protected) _parentResult(cls, propertyName) → {*}
Much like a _.result
, but ascending to parent
Parameters:
Name | Type | Description |
---|---|---|
cls |
function | class derived in usual Skull paradigm (i.e. with |
propertyName |
String |
- Inherited From:
- Source:
Returns:
Most of the times it is Object
- Type
- *
(protected) _registerComponent(componentName) → {Object}
Creates application component and registers it, following config
Parameters:
Name | Type | Description |
---|---|---|
componentName |
String | should be present in params passed to application |
Returns:
instance of component
- Type
- Object
initialize(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
app options Properties
|
- Overrides:
- Source:
onRoute(router, routeName, params)
Primarily dispatches route change. Feel free to override.
Parameters:
Name | Type | Description |
---|---|---|
router |
Backbone.Router | router which fired event |
routeName |
String | name of matched route |
params |
Object | parameters parsed from route, if any |
start()
Renders root view and starts up Backbone.history.
Call this when your app is ready (or pass options.autostart
to Skull.Application#initialize
).
Feel free to override.