Report an issue
Class

TemplateBinding (ui)

@ckeditor/ckeditor5-ui/src/template

class protected

Describes a binding created by the bind interface.

Filtering

Properties

  • attribute : String

    The name of the observed attribute.

  • callback : function

    A custom function to process the value of the attribute.

  • emitter : EmitterMixin

    An Emitter used by the binding to:

    • listen to the attribute change in the observable,
    • or listen to the event in the DOM.
  • observable : ObservableMixin

    An observable instance of the binding. It either:

    • provides the attribute with the value,
    • or passes the event when a corresponding DOM event is fired.

Methods

  • constructor( def )

    Creates an instance of the TemplateBinding class.

    Parameters

    def : TemplateDefinition

    The definition of the binding.

  • activateAttributeListener( schema, updater, data ) → function

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

    Parameters

    schema : TemplateValueSchema

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

    updater : function

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

    data : RenderData

    Rendering data.

    Returns

    function

    A function to sever the listener binding.

  • getValue( [ node ] ) → *

    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

    *

    The value of attribute in observable.