The element the behavior was attached to.
The name of the attribute that will be changed.
This static property lets you define listeners that will be executed whenproperties of the behavior change.
It should be a map where the keys are paths that should be watched on the behavior instanceand the values are names of methods that will be invoked on it when the valueat a path changes.
The following example shows a behavior that reacts to a change in the height ofthe defining element.
export default class MyBehavior extends Behavior { static inject: {element: Element}; static bindings = { 'element.clientHeight': 'heightChange' }; width: number; heightChange(height: number) { this.width = height * 2; }}
Updates the attribute when the result of the expressionhas changed.
Attribute behaviors are part of Mahalo's special template syntax.They can be used to change a DOM elements attribute when an expression'sresult changes.
To make use of them you can prefix the attribute you want to set witha # symbol.
Example
This simple example sets the id of a div element to the value of myPropertywhich is looked up in the local scope.
<div #id="myProperty"></div>
{ default } from mahalo/behaviors/attribute-behavior