Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Latest commit

 

History

History
26 lines (21 loc) · 671 Bytes

expressions-syntax.md

File metadata and controls

26 lines (21 loc) · 671 Bytes

{{expressions}} syntax

Expressions are a easy way to display a value in the HTML without using a data-query.

<script>
  blocks.query({
    userRole: 'admin',
    profile: {
      username: 'jdoe'
    },

    price: 2.01,
    ratio: 0.76
  });
</script>

<!-- expressions could also be found in attributes except the style attribute¹ use the css-data-query instead-->
<h3 class="user {{userRole}}">
  Welcome, {{profile.username}}.
<h3>

<!-- you could place logic in expressions -->
<input value="{{price * ratio}}" />

¹Caused by behaviour of Internet Explorer removing invalid css (e.g. expressions) from the dom.