Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to Angularjs and want to know can we use angularjs in .ejs files for writing client side applications. Also, can we write both angularjs and nodejs files in the same .ejs file? I will be grateful for any further guidance.

What I have tried:

I tried writing angularjs and nodejs codes in the same .ejs file. Its not working properly, i am confused about its usage together.
Posted
Updated 20-Feb-16 22:50pm

1 solution

Hi pinkCoder,

What both technologies have in common is the programming languge JS. Their use cases differ:

  • Node.js is designed to build server/network applications (see Node.js about), so you can execute JS code on the web server.
  • AngularJS on the other hand was introduced to add dynamic behavior to HTML pages and gets executed in your web browser (see some basic examples on angularjs.org main page).

Both run in different environments, have different ideas how to structure and bootstrap application modules and how to interact with the environment (and a lot more).


This is just a short comparison helps. If you need further explanations, please let us know what your use case is and which problem you try to solve and what you try to accomplish with Embedded JS comes in this case.


Hope this helps
— Konstantin
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900