Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot include ejs file , include method give error #245

Open
dipanshujain895 opened this issue May 24, 2019 · 0 comments
Open

cannot include ejs file , include method give error #245

dipanshujain895 opened this issue May 24, 2019 · 0 comments

Comments

@dipanshujain895
Copy link

Well, I am trying to use the include(path) method of ejs in my project it doesn't work and the paranthesis of include are printed with the path in the error
but when i changed it to include path it works,

now i want to use include(path, {variable: value})
this doesn't work and they are printing 'path , {variable: value}' as the path of file
i am attaching screenshots of the code that's working and of the code that's not please help me!!
i need help with giving the parameters in include method as ive given in screenshots

Screenshot from 2019-05-24 23-59-40
Screenshot from 2019-05-24 23-59-36
Screenshot from 2019-05-25 00-00-01
Screenshot from 2019-05-24 23-59-59
Screenshot from 2019-05-25 00-01-47
Screenshot from 2019-05-25 00-01-42
Screenshot from 2019-05-25 00-03-29
Screenshot from 2019-05-25 00-03-24

from the above images you can see if i add paranthesis to my include method the path doesn't get rendered and is printed the same what's written with the parantheis and double qoutes

but if i remove the paranthesis and double qoutes it's getting rendered correctly for the normal usage of include method i.e <%- include path %>

but the one with the parameter i am passing path is not getting rendered correctly
i.e <%- include ../includes/add-to-cart , {product:product} %>

i tried <%- include("../includes/add-to-cart", {product: product}) %>
from the official website's refrence and the github readme refrence but it's still not working as you can see in the screenshots

Please help me i am still learning node js so i don't know much!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant