Syntax differences: Sline vs Handlebars
| Functionality | Category | Handlebars | Sline |
|---|---|---|---|
| String | Single quotes | Multiple characters: 'str' | Only for single characters: 'a' |
| Double quotes | Multiple characters: "str" | Multiple characters: "str" | |
| Backticks | Not supported | Multiple characters: `str` | |
| Scope | this | {{ this.title }} | {{ title }} |
./ | {{ ./title }} | {{ title }} | |
../ | {{ ../title }} | Unable to access variables in the parent scope | |
| Expression | Array indexes | {{ products.[0].title }} | {{ products[0].title }} |
| Variable access | {{ get key (get index products) }} | {{ products[index][key] }} | |
| Comments |
| {{!-- This is a comment --}} | |
| Extended capability | Helper |
| Use tags or filters instead |
| Tag | Not supported |
| |
| Filter | Not supported | {{ "a,b,c" | split(",") | join("-") }} |
Was this article helpful to you?