Class: Extension

Binder.Binder.Extension()

new Extension()

An interface for extending the functionality of the Binder class.

Source:
Example
```javascript
import {Binder} from './Binder.js';
export default class MyExtension extends Binder.Extension {
  handleElement(binder, element, route) {
   if (!(element instanceof HTMLDivElement)) { return false; } // Only handle div elements
   element.style.borderColor = 'red'; // Outline them in red
   binder.bind(element, route); // Apply normal binding (optional)
   return true; // Indicate that the element was handled and prevent further processing
  }
}

Methods

(static) handleAttribute(binder, element, route, name, value) → {boolean}

A method for handling an attribute on an element

Parameters:
Name Type Description
binder Binder

The Binder instance that is currently processing the view.

element Element

The view element being processed.

route Route

The Route or data model being bound to the element.

name string

The name of the attribute being processed, minus the Binding.PREFIX.

value string

The value of the attribute being processed.

Source:
Returns:

If true, prevents further processing of the attribute by the Binder.

Type
boolean

(static) handleElement(binder, element, route) → {boolean}

A method for handling descendant elements.

Parameters:
Name Type Description
binder Binder

The Binder instance that is currently processing the view.

element Element

The view element being processed.

route Route

The Route or data model being bound to the element.

Source:
Returns:

If true, prevents further processing of the element by the Binder.

Type
boolean