php 是 Angularjs 客户端还是服务器端或两者兼而有之
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22301920/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is Angularjs Clientside or Serverside or Both
提问by Eswervarma
If server side: how can we connect to the database?
如果服务器端:我们如何连接到数据库?
I was using it in client side, but can it also be used server side?
我在客户端使用它,但它也可以在服务器端使用吗?
If it cannot be used server side should I use php or nodejs (I need to design a website which has a huge data bandwidth)?
如果不能使用服务器端,我应该使用php还是nodejs(我需要设计一个具有巨大数据带宽的网站)?
回答by Quentin
It is purely client side.
它纯粹是客户端。
If server side how can we connect to databases.
如果服务器端我们如何连接到数据库。
You either use a client side database or you get the data from the server using an appropriate protocol (typically this would be a web service accessed via Ajax).
您要么使用客户端数据库,要么使用适当的协议(通常是通过 Ajax 访问的 Web 服务)从服务器获取数据。
if not used in server side which one is better php or nodejs..( i need to design a website which uses huge data and bandwidth..)
如果不在服务器端使用哪个更好 php 或 nodejs..(我需要设计一个使用大量数据和带宽的网站..)
"Better" without lots of measurable requirements is highly subjective.
没有很多可衡量要求的“更好”是非常主观的。
回答by Dino
Angular JSis a client side JavaScript framework for data binding. etc..
Angular JS是用于数据绑定的客户端 JavaScript 框架。等等..
You can use Node JSfor your server side operations along with Angular JS.
您可以将Node JS与 Angular JS 一起用于服务器端操作。
or Any other server side languages like PHP, Java, Etc...
或任何其他服务器端语言,如 PHP、Java 等...
回答by NicolasMoise
Angular JS only works on the client-side. From my experience, I have found that it works best wih NodeJS (and in particular the ExpressJS framework) but any other server-side language could do.
Angular JS 仅适用于客户端。根据我的经验,我发现它最适合 NodeJS(尤其是 ExpressJS 框架),但任何其他服务器端语言都可以。
AFAIK NodeJs makes it easier to manage big data.
AFAIK NodeJs 可以更轻松地管理大数据。

