Skip to content

Conditional attributes? #259

Closed
Closed
@bestguy

Description

@bestguy

Porting some Ractive code to Svelte, and am not sure how/if conditional attributes are supported:

<div {{#if id}}id="{{id}}" {{/if}} {{#if yadda}}title="{{yadda}}" {{/if}}>...</div>

shows:

Module build failed: Error: Expected >

Is this possible to support? My example above is simplified, so always outputting an attribute with blank string is not a good solution for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions