1. Prerequesites
-
Node.js
-
npm
-
Angular CLI
First of all make a quick check on your node and angular versions. Running
ng --version
should return:
Angular CLI: [at least 7.0]
Node: [at least 8]
Update or install missing versions.
4. Development server
Run
ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
5. Code scaffolding
Run
ng generate component component-name
to generate a new component. You can also use
ng generate directive|pipe|service|class|guard|interface|enum|module`.
6. Build
Run
ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build and --aot
for ahead of time compilation.
7. Running unit tests
Run
ng test
to execute the unit tests via [Karma](https://karma-runner.github.io). The test are configured to run on TravisCI therefore a HeadlessChrome Browser is used as default browser. You can add browsers in the karma config file.
8. Running end-to-end tests
Run
ng e2e
to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
E2e tests are defined in /e2e there are only the default files generated by ng new
.