Dynamic module system

Index

Variables

Variables

acquire: (...modules: string[]) => JQueryPromise<any>

Uses require.js to obtain a module. This function returns a promise which resolves with the module instance. You can pass more than one module id to this function. If more than one is passed, then the promise will resolve with one callback parameter per module.

debug: (debug?: boolean) => boolean

Call this function to enable or disable Durandal's debug mode. Calling it with no parameters will return true if the framework is currently in debug mode, false otherwise.

defer: (action?: Function) => JQueryDeferred<any>

Creates a deferred object which can be used to create a promise. Optionally pass a function action to perform which will be passed an object used in resolving the promise.

getModuleId: (obj: any) => string

Returns the module id associated with the specified object

guid: () => string

Creates a simple V4 UUID. This should not be used as a PK in your database. It can be used to generate internal, unique ids.

isArray: (obj: any) => boolean

Checks if the obj is an array

log: (...msgs: any[]) => void

Logs data to the console. Pass any number of parameters to be logged. Log output is not processed if the framework is not running in debug mode.

setModuleId: (obj: any, id: string) => void

Sets the module id on the module.