All right time for the answer. See if you got it right. 1
So inside our home.ejs we know that we need to render a paragraph element. Inside the paragraph 2
element is where we're going to pass over a variable and we're going to render the content or the value of 3
that variable into the paragraph. 4
So in order to get the value of the variable we use the EJS tag that is angle bracket percentage 5
sign equals and then the name of the variable which we'll just call starting content. And then to close 6
off the tag we add another percentage sign and angle bracket. 7
So now we can hit save over here and we can go back to our get route and inside the res.render method 8
instead of just simply rendering the home.ejs page, 9
we're going to pass in another parameter. 10
And this is going to be a Javascript object 11
so inside a set of curly braces and it's going to be a key value pair. 12
Now the key in this case has to match with the variable name inside our home. 13
ejs because that is going to be the variable that we're going to pass over. So we can just simply select 14
Copy and paste it into here as the key. 15
Now the value is going to be whatever data it is that we want to pass over. 16
So over here that's going to be the constant home starting content so that we can pass over all of this 17
text into this variable called starting content and be able to render it inside his paragraph tag. 18
So let's go ahead and change the value to our home starting content. 19
So now if we hit save and we head over to our localhost then you'll see that we're rendering the home.ejs 20
page with the h1 and also a paragraph element that has the same content as what we've got inside here. 21
So did you manage to complete that without using too many hints? 22
If so then great job. 23
If not, then try and reduce the number of hints you need in the next challenge which is coming right 24
up.