13

我正在使用 Yeoman 1.0 beta 并且对 express-stack 分支不感兴趣。那么,在 Express 中使用 Yeoman 构建 Angular 项目的推荐/最佳方法是什么?

我尝试yo angular --minsafe在 Express 项目的根目录(where app.jsand package.jsonare)中运行,但 Yeoman 试图覆盖package.json,并且 Angular 文件没有public正确进入子目录。此外,我不确定是否可以在不破坏 Bower 和 Grunt 功能的情况下手动移动 Angular 文件。

很高兴能得到一些建议,谢谢!

4

4 回答 4

18

这个项目似乎涵盖了所有要求(甚至对 MongoDB 有可选支持):https ://github.com/DaftMonk/generator-angular-fullstack

我刚刚在本地尝试过,它可以工作:

npm install -g generator-angular-fullstack

yo angular-fullstack [appname]

有关更多信息,请参阅 GitHub 页面。

于 2013-11-20T14:03:00.870 回答
4

如果您首先通过 Bower 安装 Angular,然后将 Express 添加到package.json并运行npm install- 您将有一个 Express 服务器启动该/dist目录。(编辑app.js路由到/dist并让角度处理路由)

有关更多信息,请参阅此 SO 问题:ExpressJS 中的 Yeoman

于 2013-03-27T18:18:38.720 回答
0

这是启动 AngularJS 应用程序的替代方案的比较。其中一些也涉及 Express。

http://dancancro.com/comparison-of-angularjs-application-starters/

于 2014-07-07T21:08:41.427 回答
-1

After reading MANY blogs and answers, I managed to get it all working... Check out this repo: https://github.com/malixsys/malix-yae

  • When changes are made to html/server or lib, the server is restarted and the page should refresh
  • When changes are made to HTML or JS files under html/client, the server is not restarted but the page should refresh
  • When changes are made to CSS files under html/client, the new stylesheet should be injected directly without refreshing
于 2013-06-15T19:55:08.667 回答