javascript - Node with ejs template files and angular causing double pages to appear -


i working on application built nodejs (express), ejs, , angular. backend render layout ejs template so:

app.set('view engine', 'ejs'); app.set('layout', 'shared/layout'); 

and

    <div ui-view></div>     <%- body %> </body> 

when 404 error occurs, caught (by node), , 404 template rendered instead:

if (req.xhr) {     res.status(404).render('shared/404', { title: '404', message: 'page not found' }) } 

the problem is, when click link on 404 page, new page rendered, 404 page still 'lingers' @ bottom (2 pages shown @ once).

should handled frontend instead? or problem backend set (and best practices here?), or need force kind of 'hard refresh' of page when link clicked, 404 template goes away? have tried using angular hard refresh: <a ui-sref="state1" ui-sref-opts="{reload: true}">state 1</a> backend seems inject href="state1" (i presume before angular takes over?)


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -