publicclass/express-partials

locals scope stopped working with EJS

Opened this issue · 0 comments

All local variables used to be scoped to locals but now that is no longer the case as locals is undefined in EJS templates rendered via partial()

e.g. the following now throws an error:

parent template:

<%- partial('user', {name: 'Aaron'}) ->

user partial template:

<h1>Hello, <%= locals.name %></h1>