node.js - How to interpret this jade code into HTML? -


i'm learning jade , following tutorial on user account creation.

i using jade html converter, program can't seem figure out bit of code:

 #user                 h1.text-center.login-title welcome #{user.firstname}. check details below:                     div.signup-wall                         ul.user-details                             li username ---> #{user.username}                             li email    ---> #{user.email}                             li first name ---> #{user.firstname}                              li last name ---> #{user.lastname} 

specifically, #{user.firstname} part confusing. mean, , how 1 translate html?

it's templating engine variable, it's supposed injected while rendering jade html, done server this:

app.render('login.jade', {     user: {         username: 'xyz'     } }) 

if you're trying convert (login.jade) pure html (login.html) chances can't translated because pure html isn't dynamic inject values, or you'll have manually write user.username supposed be.

<li> xyz </li> 

more info jade: http://jade-lang.com/reference/interpolation


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -