简体   繁体   English

将Angular.js与Node.js集成(Express + Tower.js)

[英]Integrating Angular.js with Node.js (Express+Tower.js)

I am new to node. 我是节点新手。 I very much like approach of AngularJS. 我非常喜欢AngularJS的方法。 I like what I see in towerjs. 我喜欢我在towerjs中看到的东西。

Has Anyone wired the two together? 有人把两者连在一起吗? I have in mind tower primarily for backend api/rest and angular for clientside. 我想到塔主要用于后端api /休息和客户端角度。

I'm especially not familiar with tower.js, but from the docs it looks like it might not be practical to use the two together. 我对tower.js特别不熟悉,但从文档来看,将两者结合使用可能并不实际。 There is quite a bit of overlap in the things AngularJS provides and the things tower.js provides (especially models, views, and controllers on the client). AngularJS提供的东西和tower.js提供的东西(特别是客户端上的模型,视图和控制器)有很多重叠。

I've written on how to use AngularJS with a RESTful API provided by Express on my blog . 我已经写过如何在我的博客上使用Angular提供的RESTful API的AngularJS Maybe that can help you get started. 也许这可以帮助你开始。

Good luck! 祝好运! :) :)

Tower is for the server-side while angular is on the client right? 塔是服务器端,而角是客户端吗?

So what you could try what is mentioned here . 所以你可以尝试这里提到的内容。 Just replace railway with tower. 用塔替换铁路。

You could check this brunch.io skelleton that uses angularjs. 你可以检查此brunch.io skelleton使用angularjs。

Hope this comes in handy mate! 希望这能派上用场!

As things are evolving very fast, there are some major update. 随着事态的发展非常快,有一些重大更新。

For example, a framework named Total.js has made much work to make Angular.js work in hand with Node.js. 例如,名为Total.js的框架已经做了很多工作,使Angular.js与Node.js一起工作。

Please have a look at their web site http://www.totaljs.com/totalstack/ and at the 6 (!) example they provide on how to use it : https://github.com/totaljs/examples . 请查看他们的网站http://www.totaljs.com/totalstack/,以及他们提供的有关如何使用它的6(!)示例: https//github.com/totaljs/examples

Pretty amazing! 相当了不起! Hope that helps! 希望有所帮助!

Note: I have no affiliation with Total.js at all. 注意:我根本没有与Total.js的关联。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM