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

Is there a way to use ejs on the front-end? #752

Closed
socreative opened this issue Mar 7, 2024 · 3 comments
Closed

Is there a way to use ejs on the front-end? #752

socreative opened this issue Mar 7, 2024 · 3 comments

Comments

@socreative
Copy link

I am looking to use a JS based templating on the front-end and I used ejs with Node but is there a way to use EJS on the frontend?
I am getting TypeScript compiler errors with trying to use in in Angular as ejs relies on node processes.

@AnshSinghSonkhia
Copy link

You have to fetch and render your EJS code in Angular, as of what I remember of the time when I used it.

And, this will be achieved using HttpClient from '@angular/common/http' and Component & OnInit from '@angular/core'

@socreative
Copy link
Author

i was just thinking i could have the template as a string and use the EJS render() method, but i cant even import EJS to use it. it references node's fs and process which dont exist on the frontend

@RyanZim
Copy link
Collaborator

RyanZim commented Mar 7, 2024

@socreative browser-compatible builds can be downloaded from https://github.com/mde/ejs/releases/

@RyanZim RyanZim closed this as completed Mar 7, 2024
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

3 participants