Dynamic module composition

Index

Variables

Interfaces

Functions

Variables

current: CompositionTransation

Represents the currently executing composition transaction.

defaultStrategy: (context: 'durandal/composition'.CompositionContext) => JQueryPromise<HTMLElement>

Eecutes the default view location strategy.

param

The composition context containing the model and possibly existing viewElements.

returns

A promise for the view.

defaultTransitionName: string

The name of the transition to use in all compositions.

default

null

Functions

addBindingHandler(name: any, config?: KnockoutBindingHandler, initOptionsFactory?: (element?: HTMLElement, valueAccessor?: any, allBindingsAccessor?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => any): any

Registers a binding handler that will be invoked when the current composition transaction is complete.

Parameters

  • name: any

    The name of the binding handler.

  • config?: KnockoutBindingHandler optional
  • initOptionsFactory?: (element?: HTMLElement, valueAccessor?: any, allBindingsAccessor?: any, viewModel?: any, bindingContext?: KnockoutBindingContext) => any optional

Returns

any

compose(element: HTMLElement, settings: CompositionContext, bindingContext: KnockoutBindingContext)

Initiates a composition.

Parameters

  • element: HTMLElement

    The DOMElement or knockout virtual element that serves as the parent for the composition.

  • settings: CompositionContext

    The composition settings.

  • bindingContext: KnockoutBindingContext

convertTransitionToModuleId(name: string): string

Converts a transition name to its moduleId.

Parameters

  • name: string

    The name of the transtion.

Returns

string

The moduleId.

getParts(elements: Array<HTMLElement>): any

Gets an object keyed with all the elements that are replacable parts, found within the supplied elements. The key will be the part name and the value will be the element itself.

Parameters

  • elements: Array<HTMLElement>

    The elements to search for parts.

Returns

any

An object keyed by part.

getParts(element: HTMLElement): any

Gets an object keyed with all the elements that are replacable parts, found within the supplied element. The key will be the part name and the value will be the element itself.

Parameters

  • element: HTMLElement

    The element to search for parts.

Returns

any

An object keyed by part.