Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringLiteral

The StringLiteral class is the most basic building block of Aych that extends Renderable. The StringLiteral holds a string that when rendered can parse templates.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Constructor

    Parameters

    • str: any

      The underlying string

    • Default value escape: boolean = true

    Returns StringLiteral

Properties

Protected templates

templates: SimpleObject

Accessors

r

  • get r(): string
  • Getting for the HTML returned by the render function.

    Returns string

Methods

append

  • Appends templates to the existing templates object.

    Parameters

    • templates: SimpleObject

      Key-value pairs that map to a template rendered in StringLiteral's

    • Default value prioritize: boolean = false

      Whether or not to allow appended templates to override existing template properties

    Returns Renderable

internalRender

render

  • Renders the internalRender function.

    Parameters

    Returns string

toString

  • toString(): string
  • Overrides the toString method called by JavaScript when string concatenate occurs

    Returns string

when

  • Turn on and off the ability for this element to render

    Parameters

    • condition: boolean

      The condition that determines whether or not the element can render.

    Returns Renderable

with

  • Sets the templates.

    Parameters

    • templates: SimpleObject

      Key-value pairs that map to a template rendered in StringLiteral's

    Returns Renderable

Generated using TypeDoc