Constructor
new module:ct-presenter /Presenter Renderer(view Model, template Id)
Constructs a new instance of PresenterRenderer
.
Parameters:
Name | Type | Description |
---|---|---|
viewModel |
Object | A |
templateId |
String | ID of the template that the |
Methods
add Component Lifecycle Listener(listener)
Add a listener that will be informed of component life-cycle events. Note that this will only trigger onOpen
and
onClose
events. This is for compatability with the rest of the Presenter framework that is expecting presenter
components.
Parameters:
Name | Type | Description |
---|---|---|
listener |
Object |
bind View()
Binds the view to the model if it hasn't already been bound
destroy()
Destroys the bound element.
get Element() → {DOMElement}
On first call it will bind the view model to the template and return a DOM node, that can then be used to insert into the DOM. On subsequent calls it will returned the previously created DOM node.
Returns:
- Type
- DOMElement
get Presentation Model() → {Object}
Return the view model used in this renderer.
Returns:
- Type
- Object
get Template Id() → {String}
Return the template ID used in this renderer.
Returns:
- Type
- String
is View Attached() → {Boolean}
Returns true if the view has been attached.
Returns:
- Type
- Boolean
is View Bound() → {Boolean}
Returns true if the view has been bound.
Returns:
- Type
- Boolean
remove Component Lifecycle Listener(listener)
Removes a component life-cycle event listener.
Parameters:
Name | Type | Description |
---|---|---|
listener |
Object |
view IsOpened()
Components must call this method from their onOpen
callback. This signals all interested parties that the view has
been attached to the DOM and is now visible.