Interface DurandalAppModule

Hierarchy

Index

Properties

Methods

Properties

public title: string

The title of your application.

Methods

public closeDialog(obj: any, results?: Array<any>): any

Closes the dialog associated with the specified object. via the dialog plugin.

Parameters

  • obj: any

    The object whose dialog should be closed.

  • results?: Array<any> optional

Returns

any

public configurePlugins(config: Object, baseUrl?: string)

Configures one or more plugins to be loaded and installed into the application.

method

configurePlugins

Parameters

  • config: Object

    Keys are plugin names. Values can be truthy, to simply install the plugin, or a configuration object to pass to the plugin.

  • baseUrl?: string optional

public off(events: string, callback: Function, context?: any): T in DurandalEventSupport<T>

Removes the callbacks for the specified events.

chainable

Parameters

  • events: string
  • callback: Function
  • context?: any optional

Returns

T in DurandalEventSupport<T>

public on(events: string): DurandalEventSubscription

Creates a subscription or registers a callback for the specified event.

Parameters

  • events: string

    One or more events, separated by white space.

Returns

DurandalEventSubscription

A subscription is returned.

public on(events: string, callback: Function, context?: any): T in DurandalEventSupport<T>

Creates a subscription or registers a callback for the specified event.

Parameters

  • events: string

    One or more events, separated by white space.

  • callback: Function
  • context?: any optional

Returns

T in DurandalEventSupport<T>

The events object is returned for chaining.

public proxy(events: string): Function

Creates a function that will trigger the specified events when called. Simplifies proxying jQuery (or other) events through to the events object.

Parameters

  • events: string

    One or more events, separated by white space to trigger by invoking the returned function.

Returns

Function

Calling the function will invoke the previously specified events on the events object.

public setRoot(root: any, transition?: string, applicationHost?: string)

Sets the root module/view for the application.

Parameters

  • root: any

    The root view or module.

  • transition?: string optional
  • applicationHost?: string optional

public setRoot(root: any, transition?: string, applicationHost?: HTMLElement)

Sets the root module/view for the application.

Parameters

  • root: any

    The root view or module.

  • transition?: string optional
  • applicationHost?: HTMLElement optional

public showDialog(obj: any, activationData?: any, context?: string): JQueryPromise

Shows a dialog via the dialog plugin.

Parameters

  • obj: any

    The object (or moduleId) to display as a dialog.

  • activationData?: any optional
  • context?: string optional

Returns

JQueryPromise

A promise that resolves when the dialog is closed and returns any data passed at the time of closing.

public showMessage(message: string, title?: string, options?: Array<string>, autoclose?: boolean, settings?: Object): JQueryPromise

Shows a message box via the dialog plugin.

Parameters

  • message: string

    The message to display in the dialog.

  • title?: string optional
  • options?: Array<string> optional
  • autoclose?: boolean optional
  • settings?: Object optional

Returns

JQueryPromise

A promise that resolves when the message box is closed and returns the selected option.

public showMessage(message: string, title?: string, options?: DialogButton[], autoclose?: boolean, settings?: Object): JQueryPromise

Shows a message box.

Parameters

  • message: string

    The message to display in the dialog.

  • title?: string optional
  • options?: DialogButton[] optional
  • autoclose?: boolean optional
  • settings?: Object optional

Returns

JQueryPromise

A promise that resolves when the message box is closed and returns the selected option.

public start(): JQueryPromise

Starts the application.

Returns

JQueryPromise

public trigger(events: string, eventArgs?: Array<any>): T in DurandalEventSupport<T>

Triggers the specified events.

chainable

Parameters

  • events: string
  • eventArgs?: Array<any> optional

Returns

T in DurandalEventSupport<T>