+ 1
'locals' object in node js
i used res.render('/path', {prop: value}) in one file then i have to check if the variable exist in other file why should i use locals.prop name instead of property directly when I'm using the only property later.
1 Antwort
0
I guess you are probably using a templating engine like ejs, as ejs exposes the variables passed down from your backend using the locals object, see ejs documentation for more answers on your question