Home Reference Source
import ViewController from '~/controllers/ViewController.js'
public class | source

ViewController

Manages a View of any type with iOS-esque handlers.

Static Method Summary

Static Public Methods
public static

forClass(className: string, predicate: Function, root: HTMLElement)

Creates a view controller directly for all members of a class.

public static

of(elem: string | Element): ViewController

Returns a canolical VC of an element if it exists

Constructor Summary

Public Constructor
public

constructor(root: HTMLElement)

Static Public Methods

public static forClass(className: string, predicate: Function, root: HTMLElement) source

Creates a view controller directly for all members of a class. You can specify a custom predicate.

Params:

NameTypeAttributeDescription
className string
predicate Function

Takes elem, return array of params

root HTMLElement

Root element to search from

public static of(elem: string | Element): ViewController source

Returns a canolical VC of an element if it exists

Params:

NameTypeAttributeDescription
elem string | Element

Element id (no check if the element does not exist) or elem.

Return:

ViewController (nullable: true)

Public Constructors

public constructor(root: HTMLElement) source

Params:

NameTypeAttributeDescription
root HTMLElement

The element to which the controller is associated