@anzaui/engine - v0.6.0
    Preparing search index...

    Class Template

    One parsed template: its source, digest, chunks and compiled render function. Get one with Engine.get or one.

    const tpl = engine.get('feed/card.html');
    tpl.digest; // hex SHA-256 of the file
    tpl.bind({ title: 'Live Update' }); // '<ui-card>Live Update</ui-card>'
    Index
    • Parameters

      • name: string

        Path relative to the root with / separators.

      • path: string

        The path the file was read from.

      • raw: string

        The file contents.

      • digest: string

        Lowercase hex SHA-256 of the contents.

      • chunks: Chunk[]

        The parsed chunks (see extract).

      • options: LoadOptions = {}

        Escaping mode.

      Returns Template

    chunks: Chunk[]

    The parsed chunks.

    digest: string

    Lowercase hex SHA-256 of the contents.

    name: string

    Path relative to the root, e.g. pages/home.html.

    path: string

    The path the file was read from (root joined with name).

    raw: string

    The file contents.

    The compiled render function (see compile).

    • Render the template with params.

      Parameters

      • Optionalparams: Params

        Values for the placeholders.

      Returns string

      The bound HTML.