Skip to content

Commit

Permalink
Merge pull request #125 from sveltejs/gh-106
Browse files Browse the repository at this point in the history
disable REPL for examples that aren't REPL-friendly
  • Loading branch information
Rich-Harris authored Aug 6, 2017
2 parents 3ab7af6 + ff47151 commit 42f18fb
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions guide/02-template-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ As with tags, you can use any JavaScript expression in triples, and it will auto

Control whether or not part of your template is rendered by wrapping it in an if block.

```html
```html-no-repl
{{#if user.loggedIn}}
<a href='/logout'>log out</a>
{{/if}}
Expand All @@ -69,28 +69,16 @@ Control whether or not part of your template is rendered by wrapping it in an if
{{/if}}
```

```hidden-data
{
"user": { "loggedIn": false }
}
```

You can combine the two blocks above with `{{else}}`:

```html
```html-no-repl
{{#if user.loggedIn}}
<a href='/logout'>log out</a>
{{else}}
<a href='/login'>log in</a>
{{/if}}
```

```hidden-data
{
"user": { "loggedIn": false }
}
```

You can also use `{{elseif ...}}`:

```html
Expand Down

0 comments on commit 42f18fb

Please sign in to comment.