This example project is based on angular-seed. For more details check the presentation in the repo.
git clone https://github.com/jenofdoom/intro-to-angularjs.git intro-to-angular
cd intro-to-angular
next, follow the instuctions at https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions for "Debian and Ubuntu based Linux distributions". Then, in the same intro-to-angular directory, continue on with:
npm install
npm run update-webdriver
echo 'export CHROME_BIN="/usr/bin/chromium-browser"' >> ~/.bashrc && source ~/.bashrc
npm start
then browse to http://localhost:8000/app/index.html.
- Install git for windows from http://git-scm.com/download/win (choose all the default options in the installer).
- Install node.js using the Windows Installer from https://nodejs.org/en/download/ (with all the default options).
- From the Start Menu, run Git Bash (not Git GUI) by right clicking it and selecting "Run as administrator". Note that you won't normally need to run it as adminstrator, but we have to for the initial installation steps that follow.
- Run the following command (note you can use the Insert key to paste into git bash):
git clone https://github.com/jenofdoom/intro-to-angularjs.git intro-to-angular
thencd intro-to-angular
thennpm install
(answer no to the bower stats question) and finallynpm start
- In a web browser, browse to: http://localhost:8000/app - the webserver that we have runnning locally will serve the application. As we edit the files it will reload automatically. If you need to stop the server you can halt it with Control-C (but you should leave it running while developing).
- When you want to start altering files, just open up the intro-to-angular folder in a file browser and open open the various files with a text editor (Notepad will do but I'd suggest installing Atom or Notepad++).
- (Optional) For any other commands that need to be run from a command line (e.g. running some of the tests), open a new instance of git bash and cd back to the intro-to-angular folder. Note in order to use protractor (for the e2e tests) you will have to install the JDK from Oracle (that's the first of the three download buttons) and also run the following command (after restarting Git Bash)
npm run update-webdriver
. When the tests run for the first time you will have to grant permissions for Windows Firewall for the tests to be able to run correctly.
- Install git by following the instructions at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git#Installing-on-Mac (if you don't have it set up already, the installing Xcode method mentioned is simplest)
- Install node using the Mac Installer from https://nodejs.org/en/download/ (all the default options should be fine).
- In a terminal window, run the command
git clone https://github.com/jenofdoom/intro-to-angularjs.git intro-to-angular
thencd intro-to-angular
thennpm install
and finallynpm start
- In a web browser, browse to: http://localhost:8000/app - the webserver that we have runnning locally will serve the application. As we edit the files it will reload automatically. If you need to stop the server you can halt it with Control-C (but you should leave it running while developing).
- When you need to start editing files, you just need to use a text editor (I recommend Atom) on the files in the intro-to-angular folder.
From the root directory of the project:
npm test
Rerun the tests by refreshing the page in the Chromium window that is spawned.
From the root directory of the project:
npm run protractor