node.js - NodeJS Ejs Variable Render HTML -


you can output variables using ejs so

pagescontroller.test = function() {   this.title = 'test'   this.render(); }  <title><%= title %></title> 

however tried including html in variable , displays text. possible make render html?

you need construct:

<%- title %> 

that won't escape contents of title variable.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -