gsklee
gsklee

Reputation: 4944

Yeoman - Current best way to use it with AngularJS & Express?

I am using Yeoman 1.0 beta and not interested in the express-stack branch. What, then, is the recommended/best way to use Yeoman to scaffold an Angular project within Express?

I tried running yo angular --minsafe in the root directory of the Express project (where app.js and package.json are), but Yeoman was trying to override package.json, and the Angular files didn't go into the public subdirectory properly. Also I am not sure if I can just go manually moving the Angular files around without breaking Bower and Grunt functionalities.

Would be great to have some advice, thanks!

Upvotes: 13

Views: 9678

Answers (4)

Dan Cancro
Dan Cancro

Reputation: 1471

This is a comparison of alternatives for starting an AngularJS app. Several of them involve Express too.

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

Upvotes: 0

nwinkler
nwinkler

Reputation: 54507

This project seems to cover all of the requirements (and even has optional support for MongoDB): https://github.com/DaftMonk/generator-angular-fullstack

I've just tried it locally and it works:

npm install -g generator-angular-fullstack

yo angular-fullstack [appname]

See the GitHub page for more info.

Upvotes: 18

malix
malix

Reputation: 3582

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

Upvotes: -1

Orbits Irth
Orbits Irth

Reputation: 81

If you install Angular first through Bower, then add Express to package.json and run npm install - you'll have an Express server fire-up the /dist directory. (Edit app.js to route to /dist and let angular handle routing)

See this SO question for more information: Yeoman inside ExpressJS

Upvotes: 4

Related Questions