Node.js Express EJS Layouts and Partials Tutorial

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 210

  • @RaddyDev
    @RaddyDev  4 года назад +19

    I had to re-upload. I hope that you all find the video useful, I am looking forward to exploring NodeJS and if you have any future suggestions please let me know. Thank you for being here

    • @riasgrimori6505
      @riasgrimori6505 4 года назад

      thanks ❤️❤️

    • @RaddyDev
      @RaddyDev  4 года назад

      @@riasgrimori6505 ❤️

    • @pavelpetrov2939
      @pavelpetrov2939 2 года назад +1

      Bro this is the best ejs layout video ON THE WEB please continue your amazing work!

    • @RaddyDev
      @RaddyDev  2 года назад

      @@pavelpetrov2939 I appreceate the comment, Pavel. Thank you!

    • @axelD880
      @axelD880 2 года назад

      YOU'RE THE BEST BRO, KEEP CONTINUE TEACHING :D

  • @collinskariuki7089
    @collinskariuki7089 3 месяца назад +1

    I was stuck with that layout error and your video solved it for me and taught me how to use EJS layouts. Thank you so much for creating such helpful content.

    • @RaddyDev
      @RaddyDev  3 месяца назад

      Glad it helped!

  • @GuilhermeRera
    @GuilhermeRera 2 года назад +1

    I just read about the EJS Layouts, Googled "express ejs layouts" tutorial, found your video and 27 minutes later i know everything i need about ejs layouts. Thanks for this video!

    • @RaddyDev
      @RaddyDev  2 года назад +1

      I am glad that you found my video and you found it useful. Thanks for the comment!

  • @umaedu3097
    @umaedu3097 Год назад

    You have no idea how much I searched to find a video that explained what I desperately needed (3 days). thank you so so much. I am your new sub and fan.

    • @RaddyDev
      @RaddyDev  Год назад

      Glad it helped and thank you for the sub my friend!

  • @mahmoudsamy5130
    @mahmoudsamy5130 3 года назад +1

    The best ever.
    I had a problem for 2 days, but with you I could fix it. Thanks a lot.

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Glad to hear that the video was helpful. Thank you for the comment 🦍👊

  • @erichgq1
    @erichgq1 2 года назад +1

    Very Very well done. A lot of coders dance about flexing their tech verbiage. I have been searching for some guidance as 5to how to use Layouts as I am trying to write
    a web that would allow different layout depending on what the user clicks. You hit it right on the money. I will switch from hbs to ejs and use it for this family photos project.
    Thank you for your willingness to take it far enough to stretch the topic. I find it interesting that no one covers the small things like favicon and paths both are part of web sites but left
    out there hanging for newbies like myself. Thank you for at least letting me finishing this project for my daughter with a little more flare. Cheers.

  • @terrybehan2264
    @terrybehan2264 2 года назад +3

    I found this to be a very useful tutorial. Thanks very much!

  • @danielnjama1470
    @danielnjama1470 4 года назад +8

    Nice tutorial, well explained.. I'm a django developer and i'm finding node equally nice. Thanks

    • @RaddyDev
      @RaddyDev  4 года назад +3

      I don't have any experience with Python / django but they look good in terms of what you can do. I do like node as there are so many great NPM packages. Thanks for the comment!

  • @Say252
    @Say252 4 года назад +3

    Congratulations dude! Good explanation. Let's go more down with complex webpage

    • @RaddyDev
      @RaddyDev  4 года назад +1

      Thank you! The next one is definitely going to be more complicated

  • @ABentPaperclip
    @ABentPaperclip Год назад

    this is a great breakdown on express EJS layouts! now to figure out how to make it work with electron 😅

  • @victor-honorato
    @victor-honorato 2 года назад

    helped me a lot bro, I wasn't able to use the css integrated with file.ejs before to watch ur lesson!

  • @theavazov
    @theavazov Год назад

    the best tutorial i have seen so far, thank you very much legend!

  • @PatrickCuauro
    @PatrickCuauro Год назад +1

    Raddy, this was amazing, thank you very much, the only difficulty I had was when declaring the path to the layouts in the app.js, I mistakenly typed "layouts" instead of "layout"
    (Newbie).

    • @RaddyDev
      @RaddyDev  Год назад +1

      I do that as well 😅

  • @Oxxygen_io
    @Oxxygen_io 2 года назад

    Thanks this cleared up my school project work. Now i get how it works!

    • @RaddyDev
      @RaddyDev  2 года назад

      I hope that you learned something cool. I don't want your teacher emailing me :-D

    • @Oxxygen_io
      @Oxxygen_io 2 года назад

      @@RaddyDev They will probably be happy with the result! :)

  • @arunkutz
    @arunkutz 3 года назад +1

    Thank you for the video. Very helpful ...
    Thanks for not cutting out the mistakes that happened also ( which i feel helps more in the troubleshooting while developing )

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Glad it was helpful! Mistakes happen all the time haha. It's annoying when it happens on a video as I am usually trying to do them as quick as possible and be straight to the point

    • @arunkutz
      @arunkutz 3 года назад

      @@RaddyDev Yes ... It's annoying ... But these could be some common mistakes and helps in the better understanding of what is allowed and what is not ...

  • @nicolaslegrand3367
    @nicolaslegrand3367 Год назад

    you answered my problem to load my pages in body using express-ejs-layouts module

  • @Russ_Paul
    @Russ_Paul 2 года назад

    Thanks for great tutorials. The question that was on my mind was how to bring in specific css for a page whilst using a default main.ejs. Say for instance css for a slideshow on the homepage, a lightbox on a portfolio page. I see on the npm page that ejs layouts has extractScripts and extractStyles, so these can be included in your ejs content e.g. index.ejs

    • @RaddyDev
      @RaddyDev  2 года назад +1

      You're very welcome! There are a few ways I can think of. One is to actually modify your main layout and use it only for the layout of the page and now the full HTML like I did. In this case, you'll be able to put your own document information for each page you have. That would be good for SEO too. The other way would be to pass data to the main layout and rendering it with ejs. Kind of like the page title . You can do conditional logic with EJS so that would work

    • @Russ_Paul
      @Russ_Paul 2 года назад

      @@RaddyDev I will watch your vid over again. This is where I am currently. In my index.ejs I have a script src tag at the bottom of my code. In the controller I am rendering index.ejs with extractScripts set to true. In my layouts/main.ejs I have before the closing body tag. This does seem to work quite well. As I say I will go over your vid and comment, as I am sure what you are saying makes more sense :)

    • @RaddyDev
      @RaddyDev  2 года назад +1

      @@Russ_Paul The extra script looks like a good way of doing it

  • @gr8tbigtreehugger
    @gr8tbigtreehugger 2 года назад +1

    Many thanks for this super helpful and clear video!

    • @RaddyDev
      @RaddyDev  2 года назад

      Glad it was helpful!

  • @mohammadhisbullah9332
    @mohammadhisbullah9332 Год назад +1

    thanks raddy for this video

  • @ВладиславБойко-й8ч
    @ВладиславБойко-й8ч 2 года назад +2

    You helped me so much!! Thank you

  • @MDSAKIB-in2sm
    @MDSAKIB-in2sm Год назад

    Bhaiya ji, you really made a best playlist to learn thanks for it ❤❤

  • @arutselvamSaravananandha
    @arutselvamSaravananandha Год назад

    you are doing great , keep sharing your knowledge. Thank you so much ✨✌️

    • @RaddyDev
      @RaddyDev  Год назад

      Appreciate it, thank you and I will do ✌️

  • @maximk7816
    @maximk7816 3 года назад +1

    That was helpful! Very basic, with little explanation, but helpful! Thank you

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad that you found it helpful. Thanks for the comment!

  • @italoserviocarvalho562
    @italoserviocarvalho562 3 года назад +1

    Really good and complete video bro, congrats!

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you! 👊😎

  • @java0405
    @java0405 Год назад

    This video has been very helpful to me. thank you.

    • @RaddyDev
      @RaddyDev  Год назад

      You're very welcome!

  • @supertechz754
    @supertechz754 2 года назад

    Thankyou for this awesome tutorial.
    It help me a lot in understanding ejs.
    Thank you again!!!

    • @RaddyDev
      @RaddyDev  2 года назад

      Glad to hear that you found it useful!

  • @aaabbb-qv4ff
    @aaabbb-qv4ff 3 года назад +4

    Nice! Add webpack 5 on top of that, and it will be super usefull. Your next video should be on this topic (webpack and ejs templating on multipage).

    • @Markus-iq4sm
      @Markus-iq4sm 9 месяцев назад

      why would you need a webpack on top?

  • @isagive
    @isagive 2 года назад +1

    Always great tutorials 👍

    • @RaddyDev
      @RaddyDev  2 года назад

      Thank you, Imri! 👊🦍

  • @dntiberk
    @dntiberk 2 года назад

    This tutorial is a very good. Thank you for sharing....

    • @RaddyDev
      @RaddyDev  2 года назад

      Glad that you like it. Thanks for the comment

  • @kevgmei
    @kevgmei 3 года назад +1

    Thanks, dude! This helped me get my stuff setup nice and easy!

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad to hear that, Kevin! Thanks for the comment!

  • @dineshr3841
    @dineshr3841 3 года назад

    Well explained...very easy to understand..👍👍

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad to hear that! Thank you

  • @Sapphiamur
    @Sapphiamur 2 года назад

    Thank you so much, very helpful and clear tut! :)

    • @RaddyDev
      @RaddyDev  2 года назад

      Glad it was helpful!

  • @TypeScriptTV
    @TypeScriptTV 2 года назад

    Very nice tutorial on how to start with Embedded JavaScript templates (EJS). 👍

    • @RaddyDev
      @RaddyDev  2 года назад

      Thank you TypeScript!

    • @RaddyDev
      @RaddyDev  2 года назад

      Your channel looks so good!

  • @songalexgm7148
    @songalexgm7148 3 года назад +1

    Great~! Thanks for your helpful lesson.
    I hope next lesson is soon.

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you! Yep, working on a few ideas 👌😎

  • @Abi-rv3qk
    @Abi-rv3qk 10 месяцев назад +1

    Thanks ❤
    Useful

  • @ossenbrueck
    @ossenbrueck 2 года назад

    thanks for sharing your knowledge.

  • @shxdo3712
    @shxdo3712 Год назад

    Great video, i've learn a lot !!! thank you

  • @furkantural8799
    @furkantural8799 4 года назад

    thank man it's help to understand how to work this middleware. it actually very simmiler to building detail page instead of detail page we render all html element(not just specific content) in single file, it save our time to building html skelet for each page we just write elements.

    • @RaddyDev
      @RaddyDev  4 года назад

      I am glad that you found it useful and thank you for watching

  • @zachfenton608
    @zachfenton608 2 года назад

    Great tutorial, I am having problem getting the sidebar to display correctly.

    • @RaddyDev
      @RaddyDev  2 года назад

      The sidebar is just an html side element so I would assume that it's something to do with CSS rather than ejs. You need to have a div with a class name of layout-sidebar wrapping the main and side. Also don't forget the CSS.

  • @chineduchiaju2519
    @chineduchiaju2519 3 года назад

    Just started with nodejs and this was helpful....
    Jeez i wish they can still be better way because Laravel still beats this in terms of laravel blade

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Glad to hear that you found it helpful. Laravel is a beast of a framework

  • @balaraja9183
    @balaraja9183 2 года назад

    Really Good tutorial😊

  • @jatilyadav4000
    @jatilyadav4000 3 года назад

    very nice explaination....

  • @jatilyadav4000
    @jatilyadav4000 3 года назад

    thank you soo much for this informative video....

    • @RaddyDev
      @RaddyDev  3 года назад

      I love your enthusiasm! Thank you for the comments!

  • @RokoCB
    @RokoCB 3 года назад +1

    ./ is not "back" and ../ is not "double-back".
    ./ means: this (relative) directory
    ../ means: go back one directory
    Two directories back would be like: ../../
    Nice and straightforward tutorial BTW

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Thanks, Roko! Glad that you like the video

  • @skyesschrodinger5532
    @skyesschrodinger5532 3 года назад

    thank you, it really help me a lot

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad to hear that, Skyes! Thank you for watching!

  • @shaikzuhair8537
    @shaikzuhair8537 3 года назад

    Thanks for best explanations

    • @RaddyDev
      @RaddyDev  3 года назад

      I am glad to hear that you found it easy to follow. Thank you 👊🦍

  • @KaranDhingra
    @KaranDhingra 3 года назад +1

    Thank You So much.

    • @RaddyDev
      @RaddyDev  3 года назад

      Thanks for the comment, Karan! Awesome avatar btw

  • @awaraamin6850
    @awaraamin6850 3 года назад

    super useful input! Thank you

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad that you found it useful! Thank you for the comment

  • @bacon37460
    @bacon37460 3 года назад

    Great piece of layouts, thanks man!

  • @velmuruganr9321
    @velmuruganr9321 2 года назад

    Im an absolute newbie to node...could you recommend me something? I've been watching your tutorials for about two weeks..great work brother

    • @RaddyDev
      @RaddyDev  2 года назад

      Hey Velmurugan, my recommendation would be to think of a project and try to build it. Tutorials are great, but practice makes perfect. Every time you find a problem that you can't solve you can watch or read a tutorial on it. Keep going, keep practising and you will be a pro in no time 😉

  • @horaciozorola3249
    @horaciozorola3249 4 года назад +3

    Hi Raddy,
    Is EJS recommendable for develop an ERP system?
    If EJS it's not recommendable, which another template engine or framework would be right to dev the erp system?
    I'll really appreciate your feedback.

    • @RaddyDev
      @RaddyDev  4 года назад +4

      I think that this is a personal preference to what you like, what you are good at, you have to consider the skills set of your team (if you are working with one.) and plan for the future.
      If you already have experience with Angular, Vue or React I would pick one of them for the front end development. They are all great for performance, resources, scalability and when you need help, you'll easily find people to hire.
      The positive about using Node.js with Express and EJS is that your application is all in one place and you can structure your code the way you like. So if you are building an app/website I really don't see the problem of using EJS.
      One thing that I don't fully like about EJS is the syntax. I find it hard to write, but that could be because I am not used to it. There are many other alternatives templating languages
      This is an interesting topic. Thanks for the question and I hope that this helps.
      What do you think that you are going to do?

  • @sanjayr.prajapati3496
    @sanjayr.prajapati3496 4 года назад

    Very Helpful Video. Thanks.

    • @RaddyDev
      @RaddyDev  4 года назад +1

      I am glad that you found it useful. Thank you for watching and thanks for the comment!

  • @frankiejrey
    @frankiejrey 2 года назад +1

    Thank you for showing this method! I will try it out. Quick question, how would this differ from using JS custom elements with JS objects?

    • @RaddyDev
      @RaddyDev  2 года назад

      You don't need templating engines, but they have a lot of useful features. It essentially makes your pages dynamic where you can send some data to the templating engine and render the data. I find them easy to use, read, understand and structure

  • @romanext921
    @romanext921 2 года назад

    This is so nice. Looks like good ol php 😅👍

  • @danybroker6119
    @danybroker6119 3 года назад

    Good job

  • @suyashartworks2183
    @suyashartworks2183 3 года назад

    Thanks man!!

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you for watching, Suyash!

  • @HsiaoChunHuang
    @HsiaoChunHuang 4 года назад

    Thanks!! the tutorial helps me a lot~

    • @RaddyDev
      @RaddyDev  4 года назад

      Thanks for the comment! I am glad that you found it useful

  • @abhishekjha7638
    @abhishekjha7638 3 года назад +1

    the background music in the introduction part was dominating your voice a bit, rest the video was great and I learned a lot, keep going ....

    • @RaddyDev
      @RaddyDev  3 года назад +1

      Unfortunately I didn't realize that the music was too loud and now I can't update the video unless I cut the intro. I might do that 🤔. Thank you for the feedback and I am glad that you liked the rest of the video

  • @kendouciabdelaliilyas
    @kendouciabdelaliilyas 4 года назад

    great explication thank you so much, keep going
    ==============================

    • @RaddyDev
      @RaddyDev  4 года назад

      Glad to hear it. Thank you!

  • @rajkumardongre3085
    @rajkumardongre3085 3 года назад

    great video

    • @RaddyDev
      @RaddyDev  3 года назад

      Glad you enjoyed it

  • @namanagrawal4868
    @namanagrawal4868 2 года назад

    how to use express layout for only few pages that i want?
    thanks in advance

    • @RaddyDev
      @RaddyDev  2 года назад

      You could still send HTML pages to be rendered if this is what you are asking. it would be something like this:
      res.sendFile('views/page.html', {root: __dirname })

  • @mrerre2236
    @mrerre2236 3 года назад

    Nice video

  • @ВалераВласенков-ю2о
    @ВалераВласенков-ю2о 11 месяцев назад

    i have a problem. What if i want to pass my data locally to some ejs component? The problem is all my ejs components have access to data.
    'Variables in your top-level data object are available to all your includes, but local variables need to be passed down'. Can i change this behavior?

    • @RaddyDev
      @RaddyDev  11 месяцев назад

      Have you tried passing data using include like this?

    • @ВалераВласенков-ю2о
      @ВалераВласенков-ю2о 11 месяцев назад

      @@RaddyDev imagine i have include(header.ejs) which is located in about.ejs. The problem is when i pass my data through api to about.ejs, then all my 'includes' inside of about.ejs have access to data. Its something like global scope where all my includes inside of about.ejs have access tto data. What i want is restrict access to global data and allow to use only the data that I pass inside the 'include' function. I ve tried u example already but my 'include' layout still has access to all data that i pass through api to about.ejs

  • @vishnuvardhan813
    @vishnuvardhan813 3 года назад

    Can you create Whole dashboard with sidebar and Auth page routing for ejs layouts...

    • @RaddyDev
      @RaddyDev  3 года назад

      That's kind of a big project, Vishnu. I started making a login system a while back, but it was taking so long I had to leave it. I have to revisit it and see what I can do. Thanks for the suggestion

  • @malufell8231
    @malufell8231 4 года назад +1

    Muito obrigada!!
    Thank you!!

    • @RaddyDev
      @RaddyDev  4 года назад

      Obrigado por assistir e obrigado pelo comentário! 🦍

  • @shijuabraham9729
    @shijuabraham9729 3 года назад

    Thank you!!

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you for watching!

  • @davidholloway8684
    @davidholloway8684 3 года назад

    Thanks for the video. Quick question related to passing code to a layout. I need to pass {success: req.flush('success, error: req.flush('error'} to my layout.
    How can I get the object in JSON? how would I use JSON.stringify to do that?

    • @RaddyDev
      @RaddyDev  3 года назад

      Did you mean flash? Yeah you can stringify it

  • @random0345
    @random0345 4 года назад +1

    Holy shit this is good!

    • @RaddyDev
      @RaddyDev  4 года назад

      That's what she said. Too early? 😄 Thank you I appreciate it

  • @rajkush0510
    @rajkush0510 3 года назад

    how can I manipulate the dom using js it shows null when I select an element with javascript

    • @RaddyDev
      @RaddyDev  3 года назад

      You would have to do that with front end javascript. Create a script.js file and include that in your HTML and then you should be able to manipulate the dom

    • @rajkush0510
      @rajkush0510 3 года назад

      @@RaddyDev thanks for the answer :)

  • @workingTchr
    @workingTchr 3 года назад +1

    You seem to have started kind of in the middle without mentioning setting up port 5000, setting up the server, etc..

    • @RaddyDev
      @RaddyDev  3 года назад +1

      That's all mentioned at minute 3:38. Also it's in the article - link in the description. I didn't want to write the full app.js file as I do it in every single tutorial. I probably should have written it. That is valuable feedback for me. Thank you

  • @freyakim2964
    @freyakim2964 4 года назад

    Thank you it works :DDD

    • @RaddyDev
      @RaddyDev  4 года назад

      Of course it does 😉 thank you for watching!

  • @mehullokhande8229
    @mehullokhande8229 3 года назад

    Actually I am getting an error when I am using the passed values(while rendering index.ejs) in the partials, saying '"value" not defined'. Any solution?

    • @RaddyDev
      @RaddyDev  3 года назад

      It sounds like you haven't declared the value. Try something like:
      res.render('index', { title: 'Home Page'})

  • @feminaj1382
    @feminaj1382 4 года назад +1

    how to run ejs in the browser with html

    • @RaddyDev
      @RaddyDev  4 года назад

      Hey, thanks for the comment. Have a look at their website documentation, it's under Getting Started.

  • @jennahesmithfe9908
    @jennahesmithfe9908 Месяц назад

    Efrain Greens

  • @joantonio6331
    @joantonio6331 3 года назад

    I did my last website using EJS and for my new one I wanted to use Vue... With SSR... Gosh it was such a bottleneck just to get the server working... then when I managed to get it working, it was running from the build so to see all the change on the fly I had to wait 20 seconds each time because I had to build... I gave up and came back to EJS

    • @RaddyDev
      @RaddyDev  3 года назад

      Ah yeah it's a pain having to build every time you make a change. EJS and handlebars are solid. So easy to get started

    • @joantonio6331
      @joantonio6331 3 года назад

      @@RaddyDev Exactly, when I switched to ejs, withing an hour I implemented a no reload navigation (I had to code it since there is not library for that), added mysql, added dynamic subdomain and now the web app almost ready.
      The only thing that I wanted in Vue was the no reload navigation

    • @RaddyDev
      @RaddyDev  3 года назад

      Feel free to share your project. It would be awesome to see it

  • @nmcnemis
    @nmcnemis 3 года назад

    Hello people. I am getting error as "variable is not defined" when I am trying to use "" tags more than 1 time. If I just put these once, no error. What could be the problem?

    • @RaddyDev
      @RaddyDev  3 года назад

      You are missing % at the end:

    • @nmcnemis
      @nmcnemis 3 года назад

      @@RaddyDev Oops, I made a typo here. :|
      I have '%' sign and whenever I am trying to use "" tags more than 1 time in the ejs file, it shows "variable not defined error". If only once, no error.
      Thanks for replying though. :)

    • @RaddyDev
      @RaddyDev  3 года назад

      So strange. You should be able to output the value as many times as you want. Let me think about it 🤔

    • @nmcnemis
      @nmcnemis 3 года назад

      @@RaddyDev Okay) Thanks man. Really appreciate the help. :D

    • @RaddyDev
      @RaddyDev  3 года назад

      I tried it like this:
      In app.js
      app.get('', (req, res) => {
      res.render('index', { title: 'Home Page'})
      })
      In index.ejs
      and it displays Home Page Home Page
      Would it be easy for you to share your code?

  • @devmashup3700
    @devmashup3700 3 года назад

    Whenever I try to render a page other than my homepage, it just renders my homepage. I even tried app.set("layout", ["file_name", "other_file_name"])

    • @RaddyDev
      @RaddyDev  3 года назад

      So you do:
      app.get('/about', (req, res) => {
      res.render('about', { title: 'About Page', layout: './layouts/sidebar' })
      })
      and it still renders your home page?

    • @devmashup3700
      @devmashup3700 3 года назад

      @@RaddyDev yep

    • @devmashup3700
      @devmashup3700 3 года назад

      @@RaddyDev ok, I might've figured out why I'm not able to do it. Can you not have your public and views folder in a src folder?

    • @RaddyDev
      @RaddyDev  3 года назад

      @@devmashup3700 You can do. You can put your 'public' folder to be called whatever you like. In this case 'src' would work absolutely fine

  • @rushirajsinhrana
    @rushirajsinhrana 4 года назад

    Dear raddy I have created ejs file with multiple forms all forms are written in modal when I click modal popups with form and by toggle class I can minimize maximize that form now the part where I am facing problem when I am posting this form in response page gets refresh and every time for new entry user have to re click on link to open form again please help I am stucked here from long time

    • @RaddyDev
      @RaddyDev  4 года назад +1

      Hey Rushirajsinh, it's happening because Express.js is a server-side framework. Ideally, you would probably want to use a client-side framework/library like Angular, Vue and React. Don't worry it's still possible to do, but you'll have to hijack the submit form. You could do that with jQuery and ajax, see example below.
      $('#yourform').on('submit', function (event) {
      // Prevent the form of causing a page refresh
      event.preventDefault();
      let data = "some data";
      $.ajax({
      url: 'localhost/',
      data: data,
      method: 'POST'
      }).then(function (response) {
      // Append the response to an HTML element
      $('.message').append(response);
      }).catch(function (err) {
      console.error(err);
      });
      });

  • @ameyislive
    @ameyislive 2 года назад

    how can i send variable into header file?

    • @RaddyDev
      @RaddyDev  2 года назад

      Let's say that you are rendering your homepage and you want to send your name to the header partial.
      In this case we are sending title and name. Name is set to Aman.
      app.get('', (req, res) => {
      res.render('index', { title: 'Home Page', name: 'Aman'})
      })
      Then we need to find where we included the header as a partial. Let's say that we are working on the full width layout.
      We include the header and pass the name like so.
      Now the header has access to it and we can use EJS to display. There is a catch. You need to be very careful assuming that you did send the data. If you didn't the code coud error. So to avoid errors, we can check if it's empty or not and set a defult value.
      In header we do:
      Header
      Now on the full width page you will get Aman, because it's defined. On the about page you will get Raddy because it's undefined. You can define it of course. I hope this helps

    • @RaddyDev
      @RaddyDev  2 года назад

      i've written a full tutorial here 😃

  • @JamesTyson-o2e
    @JamesTyson-o2e 2 месяца назад

    Alena Light

  • @richardmejias5440
    @richardmejias5440 4 года назад

    Thanks 👌

  • @sodiaagency9801
    @sodiaagency9801 3 года назад

    Thank you

    • @RaddyDev
      @RaddyDev  3 года назад

      Thank you for watching!

  • @michaelleighton3433
    @michaelleighton3433 2 года назад

    does anyone know which vs code theme this is?

    • @RaddyDev
      @RaddyDev  2 года назад

      It's Dracula 🧛‍♂️

  • @PeterRosser-q9h
    @PeterRosser-q9h Месяц назад

    Olson Haven

  • @KimberlyClark-t1n
    @KimberlyClark-t1n 2 месяца назад

    Nelson Turnpike

  • @kalyanaram4787
    @kalyanaram4787 2 года назад

    I am not sure if he was saying partial or powershell

    • @RaddyDev
      @RaddyDev  2 года назад

      😆 i am not sure either

  • @nurettinsen473
    @nurettinsen473 3 года назад

    is there for webpack

    • @RaddyDev
      @RaddyDev  3 года назад

      You can run Webpack directly in node.js runtime if this is what you are asking. So yeah :)

    • @nurettinsen473
      @nurettinsen473 3 года назад

      @@RaddyDev thank you for your answer.
      i already got it

  • @abdellatifsraiti2032
    @abdellatifsraiti2032 4 года назад

    thanks

    • @RaddyDev
      @RaddyDev  4 года назад

      Thank you for watching

  • @JoeConstance-i7h
    @JoeConstance-i7h 2 месяца назад

    Lang Fields

  • @NelsonPorter-l4x
    @NelsonPorter-l4x Месяц назад

    Ziemann Drive

  • @lotustree
    @lotustree 2 года назад

    👍

  • @yashchauhan5710
    @yashchauhan5710 4 года назад +1

    Music tooooo loud

    • @RaddyDev
      @RaddyDev  4 года назад

      I thought that it might be... Thanks for letting me know

  • @DanEdward-j6u
    @DanEdward-j6u 2 месяца назад

    0408 Baumbach Knoll

  • @amitgohri1622
    @amitgohri1622 4 года назад

    music is too loud

    • @RaddyDev
      @RaddyDev  4 года назад

      Yeah, unfortunately. Lucky the actual video is okay

  • @zeroanims4113
    @zeroanims4113 3 года назад

    you sound like errichto lmao

    • @RaddyDev
      @RaddyDev  3 года назад

      I refuse to listen to my videos 😂

  • @jonarason2995
    @jonarason2995 3 года назад

    The background killer to be white..

    • @RaddyDev
      @RaddyDev  3 года назад

      🙂

    • @jonarason2995
      @jonarason2995 3 года назад

      @@RaddyDev Very nice and clear tutorial mate

    • @RaddyDev
      @RaddyDev  3 года назад +1

      @@jonarason2995 Thanks, Jon! I appreceate that. I read your comment so many times and I didn't get it 😄

  • @thecontinugouios
    @thecontinugouios 2 года назад

    "I hope this will be the last video...", this word sounds creepy to me, because I paused right before "...with this crappy microphone"

    • @RaddyDev
      @RaddyDev  2 года назад

      I hope that you are okay, friend 🙂

  • @SamarthAgrawal251
    @SamarthAgrawal251 2 года назад

    Just a constructive feedback - a lot of places you have said "i believe this..." "i believe that" for ex this will be './layout' or '../views' . This is not helping at all. If you explain why it will be single dot or double dot ... how are we navigating in the folder structure that will make the understanding better. you have created a lot of folders and your good information is kind of getting lost in all the mis management from your end as you are figuring out while recording...

    • @RaddyDev
      @RaddyDev  2 года назад

      Thanks, Samarth. I appreciate the feedback

  • @germanduterte7110
    @germanduterte7110 4 года назад

    Your social media links in the description annoying

    • @RaddyDev
      @RaddyDev  4 года назад

      Thanks for the feedback