This feature is still experimental.
#This method is still under development, and its interface and/or behavior could change at any time.
Compile a view into an HTML template.
sails.renderView(pathToView, templateData);
Argument | Type | Details | |
---|---|---|---|
1 | pathToView | The path to the view that will be compiled into HTML. | |
2 | templateData | The dynamic data to pass into the view. |
To compile an HTML template with a customized greeting for the recipient:
var htmlEmailContents = await sails.renderView('emails/signup-welcome', {
fullName: inputs.fullName,
// Don't include the Sails app's default layout in the rendered template.
layout: false
});