Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting id dynamically in jade / id interpolation

Tags:

node.js

pug

I've tried all the permutations I can think of but alas with no success. I am trying to set an id dynamically in a jade template.

#{page.name}(data-role= 'page', data-theme= 'c', data-url='#{"#"+page.name}')

I wondering if it's actually possible. Anyone know how to do this?

If some one knows, please help me out - before all my hair falls out :(

like image 764
Chin Avatar asked Nov 24 '11 14:11

Chin


1 Answers

For anyone looking for the answer to this: Answered kindly by TJ the developer of express.

div(id=myPassedId),

div##{myPassedID}( isn't supported because it would be super ugly

like image 101
Chin Avatar answered Sep 28 '22 06:09

Chin