在.ejs文件中使用angularjs和nodejs [英] Using angularjs and nodejs in the .ejs file

查看:160
本文介绍了在.ejs文件中使用angularjs和nodejs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Angularjs的新手,想知道我们可以在.ejs文件中使用angularjs来编写客户端应用程序。另外,我们可以在同一个.ejs文件中写入angularjs和nodejs文件吗?我将不胜感激任何进一步的指导。



我尝试过:



我尝试在同一个.ejs文件中编写angularjs和nodejs代码。它不能正常工作,我对它的使用感到困惑。

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.

推荐答案

你好pinkCoder,



什么两种技术的共同点是编程语言JS。他们的用例不同:



  • Node.js旨在构建服务器/网络应用程序(参见 Node.js about ),所以你可以在Web服务器上执行JS代码。
  • 另一方面介绍了AngularJS向HTML添加动态行为页面并在您的Web浏览器中执行(请参阅 angularjs.org主页上的一些基本示例)。
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).

这只是一个简短的比较帮助。如果您需要进一步的解释,请告诉我们您的用例是什么以及您尝试解决的问题以及您尝试使用嵌入式JS实现的目标。

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.


这篇关于在.ejs文件中使用angularjs和nodejs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆