Below is a list of all the custom triggers supported in the "data-observe-js" binding attribute for DOM elements. These options are also supported when calling the public function "watch()".
Fires when a change has been detected in an object.
Parameter: oldValue: 'object' - The old value for the object.
Parameter: newValue: 'object' - The new value for the object.
Fires when a change has been detected in an object (states which property changed).
Parameter: propertyName: 'string' - The name of the property that has been changed.
Parameter: oldValue: 'object' - The old value.
Parameter: newValue: 'object' - The new value.
Fires when a watch has been cancelled.
Parameter: id: 'string' - The ID of the watch that has been cancelled.
Fires when a DOM element is no longer available in the DOM.
Parameter: id: 'string' - The ID of the DOM element.
Fires when a watch is started.
Parameter: id: 'object' - The object that the watch as started for.
<div data-observe-js="{ 'events': { 'onChange': yourCustomJsFunction } }">
Your HTML.
</div>
<script>
var version = $observe.watch( yourObject, {
events: {
onChange: yourCustomJsFunction
}
} );
</script>