reading-notes

View on GitHub
Read No. Name of chapter
12 EJS Partials

EJS Partials

Partials come in handy when you want to reuse the same HTML across multiple views.

Basic Syntax(Tags):

In this section we’ll learn how to use <%- include(‘’)-%> tag.

Project structure:

image

Lets see our index.js file:

image

home.ejs

image

EJS uses <%- include(‘’)-%> tag to include HTML from other files, in our app, we have the HTML templates at /views/template folder.