Page
Root view of page
Example:
class DetailPage extends Page {
title() {
return 'Detail Page'
}
html(data) {
return `\
<div>
<h1>${data.headline}</h1>
</div>
`
}
}
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
Whether having initial data or not |
Inherited Summary
From class Core | ||
public |
Add handler or listener for saying message |
|
public |
Cast a message to the listeners |
|
public |
unescapeHtml(escaped: String): String Unescape HTML |
|
public |
unlistened(name: string, -: Function) Remove handler or listener |
|
private |
_callR(args: *, target: *, method: *, methodOwner: *) |
|
private |
_isFn(f: *): * |
|
private |
_isStr(v: *): * |
|
private |
_listened(name: *, handler: *) |
|
private |
_privates(): {"_F_obs": *} Return non-enumerable attribute definitions. |
|
private |
_say(targetName: *, name: *, ctx: *) |
From class View | ||
public get |
data: * data to elements text or value, innerHTML of elements |
|
public set |
|
|
public |
contentEl: * |
|
public |
el: * Root element |
|
public |
parent: * |
|
public |
views: {} Subview children of the view |
|
private |
_data: * |
|
public |
appendEl(el: Element) Append child element |
|
public |
Cast a message to all children of view |
|
public |
For implement after loading completed |
|
public |
destroy() Destroy all chidren, unload, and destroy binder, teardown events |
|
public |
findEl(id: *): Element Find an element that has specified data-id else call getElementById |
|
public |
Fire event |
|
public |
Ssetting listener of events. |
|
public |
For implement creating subviews and setting listener of events. |
|
public |
prepareData(defaults: object): object | Item Prepare data |
|
public |
Set child view as name after load |
|
public |
unload() For implement unloading subviews |
|
public |
Called when the binding data is updated. |
|
private |
|
|
private |
|
|
private |
_build(root: *, props: *) _loaded resolve after all done |
|
private |
_buildFromHtml(data: *): * |
|
private |
_firstEl(el: *): * |
|
private |
|
|
private |
_parseEvts(evts: *, emap: *) |
|
private |
_privates(): * |
|
private |
Set data to subviews or elements in the view. |
|
private |
Bind targets with event handler set. |
|
private |
_setFieldValue(name: *, val: *): boolean |
|
private |
_setRootNode(root: *, parent: *, data: *) Set root node element to this.el |
|
private |
_setVal(el: *, val: *) |
|
private |
_setupProps(props: *): * |
|
private |
|
|
private |
Bind target event with handler. |
|
private |
|
Public Constructors
Public Methods
public destroy() source
Destroy all chidren, unload, and destroy binder, teardown events