baryshev / ect

Fastest JavaScript template engine with embedded CoffeeScript syntax
http://ectjs.com
MIT License
626 stars 70 forks source link

Express app.locals variables not accessible from in ECT template #34

Closed babsonmatt closed 10 years ago

babsonmatt commented 11 years ago

Can anyone else confirm this?

app.locals({ name: 'joe' })

<%- name %>

This should render 'joe', however it says 'name is undefined'.

I tried Swig as an alternative, and Swig appears to work fine.

baryshev commented 11 years ago

You trying to access local variable name. All input variables need to be prefixed with @ (this). Try to output with this code:

<%- @name %>

juanmaia commented 10 years ago

Is anyone looking at this?