EJS files: (41 Hours 30 Minutes Trained)
As of last blog I was happy with the completion of my first mini express framework app, but I did not feel comfortable that I would be able to replicate the results on my own. That being said, I did the project over a second time to be sure I understand the material.
I did this because each project builds on the last and it is expected that I retain the previous projects knowledge. Also, I am currently using the Udemy Web Dev Course by Colt Steele. In my opinion I have grown in programming skills quite a bit since beginning this course. Anyways, here is a picture of the project redone, I changed up the animal speaking algorithm to get the same result from a different angle.
Next I began working with EJS files in Node.JS. EJS stands for embedded JavaScript. I learned when creating a project directory to put the EJS files in the “view” folder that I made so Express can find them! I was hung up for 20 minutes trying to figure that one out. (which I didn’t count those 20 minutes as practice obviously because I was spinning my wheels.)
I wrote two small EJS files today. The first file had a heading <h1> and an image <img> of a dog. The second file contained one line of javascript in which the html text changed depending on the users input into the url browser. Also in EJS, JavaScript must be surrounded with these tags:
<%= placeSomeJavaScriptHere %>
…which is incredibly strange to type at first.
To make this easier to understand, let me say that both EJS files came from the same practice project. So I will post the main nodeJS(app.js) file first, and then post the EJS files that link to the app.js file. Enjoy!
So that’s all for today! If you enjoyed reading be sure to clap, follow, etc. (mainly etc.) 41 Hours of training down, only 9,959 Hours to go!