Empty Attributes

A use case which happens quite often is the rendering of attributes and their values. But we usually don't want to render attributes with empty values.

Here comes the fmt namespace into play. This namespace essentially marks an attribute so the FmxTemplateLoader generates a corresponding test.

<my-element fmt:myAttr="model.value">
    <inner c="third"/>
</my-element>
<my-element [#if model.value?has_content] myAttr="${model.value}"[/#if]>
    <inner c="third"/>
</my-element>