6

I have a Node Js project where I have all front end files in .ejs which calls the server.js which is doing back end work.

1)Does ejs provide more functionality when compared to html ?

2)Is this the node expressJs functionality ?

3)Can I do angularJs keeping extension as .ejs? eg:ng-controller Confused;-)

jeny
  • 367
  • 4
  • 6
  • 17

2 Answers2

5

1) Does ejs provide more functionality when compared to html ?

Yes, EJS and Jade are template engine for node.js and express. With they it's possible to do conditions and access variables returns from the server. Doen't is necessary to send HTML code to the response. They mix all functionality HTML (js, jquery, bootstrap, etc) plus template engine advantages.

2) Is this the node expressJs functionality ?

Is this node.js functionality.

3) Can I do angularJs keeping extension as .ejs? eg:ng-controller

Similar questions:

Community
  • 1
  • 1
BrTkCa
  • 4,703
  • 3
  • 24
  • 45
4

ejs is just a template engine.

It makes possible for you to load data from your application in the view.

For instance, in your code <title><%= title %></title>, title is a variable from your application, and what is gonna show on the screen is the variable's value.

After the template is rendered, it generates a .html file for the browser.

You can still use Angular normally.