Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Variable Syntax Doesn't Work? #183

Open
AlbinoGeek opened this issue Oct 23, 2015 · 0 comments
Open

Variable Syntax Doesn't Work? #183

AlbinoGeek opened this issue Oct 23, 2015 · 0 comments

Comments

@AlbinoGeek
Copy link

Hello,

It seems that all of the following are broken:

#1
- var selected = (this.selected ? 'selected' : '')
div(class=selected) Selected Item

#2
div(class=(this.selected ? 'selected' : '')) Selected Item

#3
div(class={selected:this.selected}) Selected Item

#4
div&attributes({class:{selected:this.selected}}) Selected Item

I know some rely on #1 , but do they all?

What about this one, that's supposedly documented?

#5
- var attribs = {class: {selected: this.selected}}
div(&dyn = attribs) Selected Item

Or even the workaround using a Template helper (polluting the application):

Hello.tpl.jade

#6
div(&dyn=attribs) Selected Item

Hello.coffee

Template.Hello.helpers
  attribs: -> class: 'selected'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant