Object Helpers API reference for object manipulation template helpers box Guide

Object Helpers

Object helpers provide utilities for working with objects in templates.

Functions

arrayFromObject

Converts an object to an array for use with {#each}.

Template Syntax

{#each arrayFromObject objectToConvert}
{key}: {value}
{/each}

Parameters

NameTypeDescription
objobjectThe object to convert

Returns

array - An array of key-value pair objects.

Example

<dl>
{#each arrayFromObject user}
<dt>{key}</dt>
<dd>{value}</dd>
{/each}
</dl>

object

Can be used to pass arbitrary data as an object to other functions.

Template Syntax

{someFunction (object key=valueForKey)}

Parameters

NameTypeDescription
objobjectThe object to create

Returns

object - The created object.

Example

<ui-dropdown options="{object
placeholder='Select a country'
selection=true
options=countries
}"></ui-dropdown>