I just wanted to create a new project with AngularJS in my daily job.
I wanted to simplify and even automate this task with using standard environments and tools. This approach is really nice for other colleagues to dive into to structure of one project, because they just have to understand the structure and logic once. Once they know where to find what, it is pretty straightforward.
One very nice approach for that is using Yeoman. Yeoman is going to offer you some nice generators that you can find right over here. You will discover that Yeoman will offer you some handy generators. One is the AngularJS generator which is created by the Yeoman itself, you can find the corresponding Github page here: AngularJS generator.
To setup a prototype as fast as possible, I thought it would be handy to have something like a fast one-liner, function or whatever. So, I did it 😉
This one-liner will install the npm dependencies globally! If you do not want to have it available globally, use the second code box. Be aware that this one-liner will immediately trigger an update and an upgrade of your Ubuntu/Debian installation. After this process it will also immediately (due to -y or also known as –yes) trigger the installation of the distribution dependencies. To have it clear, here are the distribution dependencies that will be installed:
These are the npm dependencies for this generator:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y git nodejs nodejs-legacy npm && sudo npm install -g grunt grunt-cli bower karma yo generator-angular && sudo npm install -g npm && mkdir angularjs-prototype && cd angularjs-prototype && yo angular app-name
Installing without global npm dependencies:
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y git nodejs nodejs-legacy npm && sudo npm install grunt grunt-cli bower karma yo generator-angular && sudo npm install npm && mkdir angularjs-prototype && cd angularjs-prototype && yo angular app-name
Both one-liners were tested on Debian Wheezy, Jessie and Ubuntu 14.04.3.
I will not paste the output due to its a huge output and be aware that you can grab a coffee (or two 😉 ) while downloading and installing the npm dependencies.
If you encounter any issue or have any question, feel free to contact me!