When my template contains a variable that doesn't exist in the data object, a fatal error is thrown, causing the script to shut down. Is that intentional? I wonder if there's a way to make it more forgiving.
For example, if my data object is:
var data = {
title: "Hello",
content: "Your article text here"
}
... and my HTML template contains something like:
<h1><%= title %></h1>
<p><%= author %></p>
<p><%= content %></p>
When my template contains a variable that doesn't exist in the data object, a fatal error is thrown, causing the script to shut down. Is that intentional? I wonder if there's a way to make it more forgiving.
For example, if my data object is:
... and my HTML template contains something like:
... then the server shuts down.