Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TemplatePart

A placeholder for a dynamic expression in an HTML template.

There are two built-in part types: AttributePart and NodePart. NodeParts always represent a single dynamic expression, while AttributeParts may represent as many expressions are contained in the attribute.

A Template's parts are mutable, so parts can be replaced or modified (possibly to implement different template semantics). The contract is that parts can only be replaced, not removed, added or reordered, and parts must always consume the correct number of values in their update() method.

TODO(justinfagnani): That requirement is a little fragile. A TemplateInstance could instead be more careful about which values it gives to Part.update().

Hierarchy

  • TemplatePart

Index

Constructors

Properties

Constructors

constructor

  • new TemplatePart(type: string, index: number, name?: undefined | string, rawName?: undefined | string, strings?: string[]): TemplatePart
  • Parameters

    • type: string
    • index: number
    • Optional name: undefined | string
    • Optional rawName: undefined | string
    • Optional strings: string[]

    Returns TemplatePart

Properties

index

index: number

Optional name

name: undefined | string

Optional rawName

rawName: undefined | string

Optional strings

strings: string[]

type

type: string

Generated using TypeDoc