This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
class syntax #173
Labels
Comments
Is this an official part of Jade or a proposal for new syntax? |
I think he was proposing a Coffeescript-alike format in which "foo?" returns true if foo is defined, and false if foo is not defined. Here is an example in CoffeeScript, that compiles down to JavaScript: console.log(foo) if foo? Compiles to: if (typeof foo !== "undefined" && foo !== null) {
console.log(foo);
} However, what he was asking for would require more than just this, as we're not taking "foo" as a variable name, but instead using foo as the literal output (?) I still think #1 fixed would be better: .item(class={selected:selected?}) Selected Item
.item(class={selected:true}) Selected Item
.item(class={selected:false}) Not Selected Item |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
better syntax is
class="checked? private?"
instead of
class="{{#if checked}}checked{{/if}} {{#if private}}private{{/if}}"
The text was updated successfully, but these errors were encountered: