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

Help! I am Using Vs code and it doesn't recognize ejs tags. #253

Open
fatajomustapha10 opened this issue Jul 8, 2020 · 1 comment
Open

Comments

@fatajomustapha10
Copy link

fatajomustapha10 commented Jul 8, 2020

I am Using Vs code it doesn't recognize ejs tags when they are inside an html tag like the input tag below :

<input type="checkbox" name="checkbox" value="<%=item._id%>" onChange="this.form.submit()">
Before changing the default value property from on to <%=item._id%> it would actually print on, Now it does nothing !
and in the code itself i can see that it doesn't recognize it because the color doesn't change as usual.

Any suggestion is appreciated.

@fatajomustapha10
Copy link
Author

After much trial and error(a day and a half to be precise) I used this <%- instead of <%= and it worked. According to the documentation this <%- tag outputs unescaped value into template. See full code below:

value='<%-item._id%>'
<input type="checkbox" name="checkbox" value="<%-item._id%>" onChange="this.form.submit()">
and I have a clue of how that worked but if any one can give me a comprehensive explanation that would be greatly appreciated. I would love to understand completely these how this tag works.

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