
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
Name | Type | Description |
---|---|---|
obj | object | The 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
Name | Type | Description |
---|---|---|
obj | object | The object to create |
Returns
object
- The created object.
Example
<ui-dropdown options="{object placeholder='Select a country' selection=true options=countries}"></ui-dropdown>
Numeric
Next
Reactivity