What does != do in jade/pug?

无人久伴 提交于 2019-12-05 09:29:16

It is called "interpolation".

It means that "messages()" is escaped, e.g. if you have following code:

var randomText = '<p> this is a <strong>text</strong></p>'
p= randomText

which would normally, unescaped, produce just what it is:

'<p> this is a <strong>text</strong></p>'

but if I typed this:

p!= randomText

it would actually became a p tag, looking exactly like this:

this is a text

Hope it helps you :-)

You can read more about in the documentation, here: https://pugjs.org/language/interpolation.html

you should try

if(!messages())
 table(class='table table-striped')

you have to assign some value into left hand side. otherwise just validate into if condition.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!