Class

TemplateToBinding (ui)

@ckeditor/ckeditor5-ui/src/template

class internal

Describes either:

  • a binding to an Observable,
  • or a native DOM event binding.

It is created by the to method.

Filtering

Properties

Methods

  • constructor( def )

    Parameters

    def : object
  • inherited

    activateAttributeListener( schema, updater, data ) → () => void

    Activates the listener which waits for changes of the attribute in observable, then updates the DOM with the aggregated value of TemplateValueSchema.

    Parameters

    schema : Array<TemplateSimpleValue | TemplateBinding>

    A full schema to generate an attribute or text in the DOM.

    updater : Updater

    A DOM updater function used to update the native DOM attribute or text.

    data : RenderData

    Rendering data.

    Returns

    () => void

    A function to sever the listener binding.

  • activateDomEventListener( domEvtName, domSelector, data = { data.node } ) → () => void

    Activates the listener for the native DOM event, which when fired, is propagated by the emitter.

    Parameters

    domEvtName : string

    The name of the native DOM event.

    domSelector : string

    The selector in the DOM to filter delegated events.

    data : object

    Rendering data.

    Properties
    data.node : any

    Returns

    () => void

    A function to sever the listener binding.

  • inherited

    getValue( node ) → TemplateSimpleValue

    Returns the value of the binding. It is the value of the attribute in observable. The value may be processed by the callback, if such has been passed to the binding.

    Parameters

    node : Node

    A native DOM node, passed to the custom callback.

    Returns

    TemplateSimpleValue

    The value of attribute in observable.