Understanding Local Variables in Express JS

preview_player
Показать описание
Learn how to use local variables in Express JS

Рекомендации по теме
Комментарии
Автор

Thank you DevSprout!!!! Before i clicked on this video, i was losing my patience.. but now im at peace

vidhikumar
Автор

U just made everything so clear to me... I had lots of doubts regarding this concept and u just saved me..♥️

tanayraj
Автор

Super & nice explanation of Local veriables and Middleware. Using the Middleware helped me reducing repetion instead of passing 'key value pairs' to each of the Views separately. You got a new subscriber!

shihab
Автор

What a short, clear explanation. One more request to you is, please continue your Code with Node. Please please please please

robinkartik
Автор

Thanks, for sharing Ian! It has never been clearer!

preciousadeyinka
Автор

Thanks Ian, I was a bit confused as to what res.locals is. If I understand correctly, when you pass a variable through to your view it actually adds is to res.locals behind the scenes. Thank you for clearing that up.

lukes
Автор

Thanks. I am bulding my first project and there was a need to share variable value with every page. res.locals is a perfect solution of my problem.

self-toughstudy
Автор

OMG… this video was so much helpful for me thanks

오도독-jn
Автор

Thanks buddy for the wonderful explanation!!!

cap.blue-sama
Автор

Great tutorial! When would you use one over another (res.locals.x = z vs res.render('page123', x: z))? If I understood well, the latter one only makes it available on 'page123', whereas defining it with .locals makes it available everywhere. Of course, I'm talking about situations when 'y' is not being passed from a related callback and only existing in local scope. :)

lazalaza
Автор

how do i access greeting from client javascript?

sumertheory
Автор

app.locals is also exposed to <%= %> in the same way. Why might you use res.locals over app.locals and vice versa?

ShadowDrakken
Автор

Can we use locals to show the current user informations? Will it be secure?

kadirramazn
Автор

When you said the client side I thought you were going to talk about a React app that is running inside a client folder or something. Can you use a local variable from an Express app to be used in a React app?

briana
Автор

sir I am student of colt sir. when I an doing via sir way.it is showing me Current user not found

shabbirhusain
Автор

hey man, do you offer assistance to newbies? I'm trying to parse a server-side CSV and add it to my res.locals. When I load the page I can see the data in my console log, but not on the HTML page. I think it because of the promise isn't completing on time. Like the page is loading before the promise is complete. Any chance you can help me out?

AllenAndersonTaylor
welcome to shbcf.ru