<header class="main-header">
<nav class="main-header__nav">
<ul class="main-header__item-list">
<li class="main-header__item"><a class="<%= path === '/' ? 'active' : '' %>" href="/">Shop</a></li>
<li class="main-header__item"><a class="<%= path === '/admin/add-product' ? 'active' : '' %>" href="/admin/add-product">Add Product</a></li>
</ul>
</nav>
When I try to render the page in my node js application I am getting an error. Saying there is an error
I am not so used to writing ejs but when I remove the class="<%= path === '/' ? 'active' : '' %>"
in the navigation.ejs it seems to work
Error Image
Use
<%- include('RELATIVE/PATH/TO/FILE'); %>
to embed an EJS partial in another file.<%-
instead of just<%
tells EJS to render raw HTML.;
at end of includeHere is an example...