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

ObjectView

Extends:

View → ObjectView

View for Object model

Decorators:

Test:

Constructor Summary

Public Constructor
public

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

Member Summary

Protected Members
protected get

First ancestor scope which isn't Array

Method Summary

Public Methods
public

clear(): *

public
public

valueOf(): *

public

watch(key: string, value: *): ObjectView

Add a watched property to this view instance

Protected Methods
protected

async commit(key: string, value: *)

Async render

Inherited Summary

From class View
public static
public get
public get

Parent view in current DOM tree

public get

Host element of a view in a Shadow DOM tree

protected get
protected get
public

name: *

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

Public Constructors

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

Override:

View#constructor

Params:

NameTypeAttributeDescription
template string | Element | DocumentFragment
parent View
  • optional

Protected Members

protected get scope: Object source

First ancestor scope which isn't Array

Override:

View#scope

Public Methods

public clear(): * source

Reset this view to empty data

Override:

View#clear

Return:

*

public render(data: Object): ObjectView source

Render this view with data or Update without data

Override:

View#render

Params:

NameTypeAttributeDescription
data Object
  • optional
  • default: {}

Return:

ObjectView

Emit:

CustomEvent

update event (bubble & cancelable) with oldData, newData & view detail properties

Test:

public valueOf(): * source

Get original data of this view

Override:

View#valueOf

Return:

*

Test:

public watch(key: string, value: *): ObjectView source

Add a watched property to this view instance

Params:

NameTypeAttributeDescription
key string
value *
  • optional

Return:

ObjectView

This view

Test:

Protected Methods

protected async commit(key: string, value: *) source

Async render

Params:

NameTypeAttributeDescription
key string
value *

Test: