Interface DurandalEventSupport

Hierarchy

Index

Methods

Methods

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 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>