ejs icon indicating copy to clipboard operation
ejs copied to clipboard

Unbuffered data not rendered on view from callback.

Open ArkeologeN opened this issue 12 years ago • 1 comments

I've registered an object in app.locals and then accessing it in my layout view. The object is available and it accepts callback function as the argument due to async nature.

My snippet is:

<% flash(function(msgs) { %>
    <% for(var type in msgs) { %>
        <div class="alert alert-<%= type %>"><%= msgs[type] %></div>
        <% console.log(msgs[type]) %>
    <% } %>
<% }); %>

flash object is all available and it also outputs data in console.log but unfortunately doesn't render <div> element on web page. I tried adding - or = with opening marks but failed.

Seems something wrong in ejs while dealing the output from callback function

ArkeologeN avatar Dec 21 '13 19:12 ArkeologeN

Can you paste the error you are seeing?

TimothyGu avatar Jan 24 '15 20:01 TimothyGu