1

You can output variables using ejs like so

PagesController.test = function() {
  this.title = 'test'
  this.render();
}

<title><%= title %></title>

However I tried including html in the variable and it just displays it as text. Is it possible to make it render as html?

h00j
  • 308
  • 1
  • 7
  • 18

1 Answers1

4

You need this construct:

<%- title %>

That won't escape the contents of the title variable.

robertklep
  • 198,204
  • 35
  • 394
  • 381