Tuesday 11 April 2017

how to render ejs template in HTML page on button click dynamically in nodejs

I am trying to add ejs template in html page onclick of button where i am passing data to ejs template. if i render template without data it gives error so i want to add it onclick where i am passing data to it.

<%- include ./components/farmerData -%> 

i tried with include but its showing error because at loading of page i m not passing data.

<%- defineContent('hero') %> <%- contentFor('hero')> tried using defineContent as well giving error. if its plain ejs without data it will display . 



via M patil

No comments:

Post a Comment