I have created a sails.js template: templates/box.ejs
<div id="<%= box_id%>" class="<%= box_class %>">
<% if(box_title || box_title_icon) {%>
<div class="header">
<% include icon%> <---- HERE
<span class="title"><%= box_title %></span>
<hr>
</div>
<% } %>
<div class="content">
<%= typeof box_content == 'function' ? box_content() : box_content%>
</div>
</div>
In this template I try to include another template file called icon.
But I get this error generated by sails grunt JST task:
error: Grunt :: Aborted due to warnings.
Running "jst:dev" (jst) task
>> SyntaxError: Unexpected identifier
Warning: JST failed to compile. Use --force to continue.
Is it even possible to do what I'm trying to do?
Use this
<%- include icon.ejs %>
You need a "-" after the ejs open tag and better add a extension to your filename