render

  • function
can.EJS.prototype.render  

Render a view object with data and helpers.

ejs.render(data[, helpers])

Parameters

  1. data {Object}Optional

    The data to populate the template with.

  2. helpers {Object<String,function()>}Optional

    Helper methods referenced in the template.

Returns

{String}

The template with interpolated data.

Renders an object with view helpers attached to the view.

var rendered = new can.EJS({text: "<h1><%= message %>"</h1>}).render({
  message: "foo"
},{helper: function(){ ... }})

console.log(rendered); // "<h1>foo</h1>"