The Augmented.js Next - Presentation Decorator Module.
npm install presentation-decoratorAugmented.js Presentation Decorator (MVVM) View Module
- DirectiveView
- Parameters
- DecoratorView
- Parameters
- events
- events
- remove
- bindingAttribute
- injectTemplate
- Parameters
- removeTemplate
- Parameters
- boundElement
- Parameters
- Examples
- syncBoundElement
- Parameters
- syncAllBoundElements
- addClass
- Parameters
- removeClass
- Parameters
- bindModelChange
- Parameters
- syncModelChange
- Parameters
- unbindModelChange
- Parameters
- unbindModelSync
- Parameters
- ReactiveView
- Parameters
- render
- remove
Extends DecoratorView
A DecoratorView that is designed to use templates and clean up when removed.
- options (optional, default {})
Extends Colleague
DecoratorView
An MVVM view designed around decorating the DOM with bindings.
This concept is designed to decouple the view from the backend contract.
Although this is achieved via views in general, the idea is:
As a Javascript Developer, I'd like the ability to decorate HTML and control view rendering without the use of CSS selectors
- options (optional, default {})
Custom Events Property - merge into built-in events
Events Property - Do Not Override
Remove method - Does not remove DOM elements only bindings.
bindingAttribute method - Returns the binging data attribute name
Returns string Binding attribute name
injectTemplate method - Injects a template at a mount point
#### Parameters
- template string The template to inject
- mount Element The mount point as Document.Element or String
removeTemplate method - Removes a template (children) at a mount point
#### Parameters
- mount Element The mount point as Document.Element or String
- onlyContent boolean Only remove the content not the mount point
boundElement method - returns the bound element from identifier
#### Parameters
- id string The identifier (not id attribute) of the element
#### Examples
``javascript`
from HTML:
from JavaScript: let el = this.boundElement("something");
syncBoundElement - Syncs the data of a bound element by firing a change event
#### Parameters
- id string The identifier (not id attribute) of the element
syncAllBoundElements - Syncs the data of all bound elements by firing a change events
addClass - adds a class to a bount element
#### Parameters
- id string The identifier (not id attribute) of the elementcls
- string The class to add
removeClass - remove a class to a bount element
#### Parameters
- id string The identifier (not id attribute) of the elementcls
- string The class to remove
bindModelChange method - binds the model changes to functions
#### Parameters
- func func The function to call when changing (normally render)
syncModelChange method - binds the model changes to a specified bound element
#### Parameters
- element Element The element to bind as Document.Element or string
unbindModelChange method - unbinds the model changes to elements
#### Parameters
- func func The function to call when changing (normally render)
unbindModelSync method - unbinds the model changes to a specified bound element
#### Parameters
- element Element The element to bind as Document.Element or string
Extends DecoratorView
ReactiveView - A reactive model-change managed view using virtual dom for reactive web components
- options (optional, default {}`)
Render the template (this.template)
Returns any this Context of the view
Remove the view and all binds