Tc.Sandbox Class
The sandbox is used as a central point to get resources from, grant permissions, etc. It is shared between all modules.
Item Index
Methods
Properties
Methods
addCallback
-
phase
-
callback
Adds a callback to be executed in the appropriate phase.
Parameters:
-
phase
Stringdefault: end
-
callback
Function
addModules
-
$ctx
Adds (register and start) all modules in the given context scope.
Parameters:
-
$ctx
JQueryThe jQuery context
Returns:
A list containing the references of the registered modules
getConfig
()
Object
Gets the application config.
Returns:
The configuration object
getConfigParam
-
name
Gets an application config param.
Parameters:
-
name
StringThe param name
Returns:
The appropriate configuration param
getModuleById
-
id
Gets the appropriate module for the given ID.
Parameters:
-
id
IntThe module ID
Returns:
The appropriate module
init
-
application
-
config
Initializes the Sandbox.
Parameters:
-
application
ApplicatonThe application reference
-
config
ObjectThe configuration
ready
-
callback
Collects the module status messages and handles the callbacks. This means that it is ready for the 'after' hook.
Parameters:
-
callback
FunctionThe 'after' hook module callback
removeModules
-
modules
Removes a module by module instances. This stops and unregisters a module through a module instance.
Parameters:
-
modules
MixedA list containing the module instances to remove or the jQuery context to look for registered modules in.
subscribe
-
connector
-
module
Subscribes a module to a connector.
Parameters:
-
connector
StringThe full connector name (e.g. MasterSlave-Navigation)
-
module
ModuleThe module instance
unsubscribe
-
connectorId
-
module
Unsubscribes a module from a connector.
Parameters:
-
connectorId
StringThe connector channel id (e.g. 2 or Navigation)
-
module
ModuleThe module instance
Properties
application
Application
The application
config
Object
The configuration.
hooks
Object
Contains function references to registered hooks.