What is an Embedded JS Template Engine?
shadowtime2000

shadowtime2000 @shadowtime2000

About: If you are looking at this you probably wonder who I am; teenage open source maintainer

Joined:
Jul 12, 2020

What is an Embedded JS Template Engine?

Publish Date: Feb 26 '21
6 0

Simply put, embedded JS template engines are template engines that allow you to write JS within delimiters of the template engine to control the data that is rendered.

Example

Take a look at this Eta template.

<% if (it.displayName) { %>
    Name: <%= it.displayName %>
<% } %>
Enter fullscreen mode Exit fullscreen mode

You can see how we are writing JS in the appropriate delimiters to control what data is rendered and how it is rendered.

That's really all an embedded JS template engine is, so see you next time!

Comments 0 total

    Add comment