WireBootstrap
HomeDocsBuySupport
  • Introduction
  • Overview
  • Getting Started
  • Installation
  • Connecting to Data
    • Data Connectors
      • SQL Data
      • Custom Web Services
      • Local Data
      • Other Sources
    • Data Sources
    • Discovery
    • Building a Data Connector
  • Working With Queries
    • Select Queries
      • Query Extensions
    • Stored Procedures
    • Custom Web Services
    • Executing Queries
    • ORM
  • Writing Data
  • Updates
  • Deletes
  • Working with DataTables
    • Introduction
    • Filter and Sort
    • Select and Calculate
    • Joins
    • Rows
    • Columns
  • Working with DataSets
  • Introduction
  • Executing Queries
  • Transforms
  • Writing Data
  • Data Events
  • Working with Components
    • Introduction
    • Encapsulation
    • Configuration
      • Data
      • Events
      • Observables
      • Validation
      • Display
      • Vendor
      • Custom
    • Component
    • Web Frameworks
    • Building a Component
      • Hello World
      • Data Events
      • DataSets
  • Working With Data Events
    • Introduction
    • Event Basics
    • Event Data
    • Event Actions
  • Working with Themes
    • Introduction
    • Sample Data
    • Libraries
    • Pages
    • Building a Theme Project
  • Utilities
    • Formatting
    • Expressions
    • Collections
    • Spinners
    • Copy and Merge
    • Validation
    • Loading Assets
    • Service Calls
    • Download Files
    • Browser Location
    • Types
    • Promise
  • Reference
    • wire
      • wire.Collection
      • wire.download
      • wire.validate
    • wire.data
      • wire.data.DataEvent
      • wire.data.DataModel
      • wire.data.DataPromise
      • wire.data.DataSet
      • wire.data.DataSource
      • wire.data.DataTable
        • Columns
        • Rows
      • wire.data.StoredProcedure
      • wire.data.TableQuery
    • wire.ui
      • wire.ui.Component
      • wire.ui.validate
Powered by GitBook
On this page
  • String
  • HTML

Was this helpful?

  1. Utilities

Expressions

Expressions are strings or HTML markup whose contents can be replaced with the values of an object when evaluated.

String

Use variables enclosed in brackets { } in string expressions to represent the properties of an object. The properties will be replaced with the values of the properties within the object when evaluated.

Use the string function extension eval to evaluate an expression using an object passed into the function.

const data = {company: "Acme", employee: "Fred" };

const str = "{employee} works for {company}".eval(data);

// Fred works at Acme

HTML

These same expressions can be set up inside HTML markup and evaluated using the wire.ui.eval method.

The first parameter to this method is the selector for the DOM element container for the markup. The second is the data to be used to evaluate expressions in the markup.

Consider the markup below.

<div id="exp">
    <span>{employee} works for</span><span>{company}</span>
</div>

Use the wire.ui.eval method to evaluate the containing element exp using the data object from the previous example.

wire.ui.eval("#exp", data);
PreviousFormattingNextCollections

Last updated 3 years ago

Was this helpful?