Closed xubingyang closed 5 years ago
I am trying to change the view engine to EJS. But I have some trouble with this part. `
</div>`
any help?
@xubingyang You are trying to use a completely different View Engine. You can try changing the syntax according to EJS View.
Try using the code below:
<div class="rows"> <div class="col-lg-12"> <%= if(success_msg.length > 0){ %> <%= success_msg.forEach(function(msg){%> <div class="alert alert-success"><%= msg %></div> <%= }) %> <%= } %> <%= if(error_msg.length > 0){ %> <%= error_msg.forEach(function(err_msg){%> <div class="alert alert-success"><%= err_msg %></div> <%= }) %> <%= } %> </div></div> In any case of problem please contact.
<div class="rows"> <div class="col-lg-12"> <%= if(success_msg.length > 0){ %> <%= success_msg.forEach(function(msg){%> <div class="alert alert-success"><%= msg %></div> <%= }) %> <%= } %> <%= if(error_msg.length > 0){ %> <%= error_msg.forEach(function(err_msg){%> <div class="alert alert-success"><%= err_msg %></div> <%= }) %> <%= } %> </div></div>
PS: I am a beginner as well.
I am trying to change the view engine to EJS. But I have some trouble with this part. `
any help?
@xubingyang You are trying to use a completely different View Engine. You can try changing the syntax according to EJS View.
Try using the code below:
<div class="rows"> <div class="col-lg-12"> <%= if(success_msg.length > 0){ %> <%= success_msg.forEach(function(msg){%> <div class="alert alert-success"><%= msg %></div> <%= }) %> <%= } %> <%= if(error_msg.length > 0){ %> <%= error_msg.forEach(function(err_msg){%> <div class="alert alert-success"><%= err_msg %></div> <%= }) %> <%= } %> </div></div>
In any case of problem please contact.PS: I am a beginner as well.