Home Manual Reference Source Test
import View from 'web-cell/source/view/View.js'
public class | source

View

Direct Subclass:

ArrayView, ObjectView

Abstract View

Static Method Summary

Static Public Methods
public static

Constructor Summary

Public Constructor
public

constructor(template: string | Element | DocumentFragment, nameKey: string, data: Object, parent: View)

Member Summary

Public Members
public get
public

name: *

public get

Parent view in current DOM tree

public get

Host element of a view in a Shadow DOM tree

Protected Members
protected get
protected get

Method Summary

Public Methods
public abstract

clear(): View

Reset this view to empty data

public abstract

Render this view with data or Update without data

public
public abstract

Get original data of this view

Protected Methods
protected

Static Public Methods

public static instanceOf(node: Element | DocumentFragment): View source

Params:

NameTypeAttributeDescription
node Element | DocumentFragment

Return:

View

View instance bound with node

Test:

Public Constructors

public constructor(template: string | Element | DocumentFragment, nameKey: string, data: Object, parent: View) source

Params:

NameTypeAttributeDescription
template string | Element | DocumentFragment
nameKey string

Key (littleCamelCase) of HTML data-* to get name of bound data

data Object

Empty Model for this view

parent View
  • optional

Parent view in the DOM tree

Public Members

public get content: Element | Element[] | DocumentFragment source

public name: * source

public get parent: View source

Parent view in current DOM tree

public get rootHost: Element source

Host element of a view in a Shadow DOM tree

Protected Members

protected get data: Object source

protected get scope: Object source

Public Methods

public abstract clear(): View source

Reset this view to empty data

Return:

View

public abstract render(): View source

Render this view with data or Update without data

Return:

View

public toString(): string source

Return:

string

Full markup code of this view

public abstract valueOf(): Object source

Get original data of this view

Return:

Object

Protected Methods

protected bindWith(template: Element | Element[] | DocumentFragment): View source

Params:

NameTypeAttributeDescription
template Element | Element[] | DocumentFragment

Return:

View

This view or the view bound before

Test: