The Angular CLI is a tool to initialize, develop, scaffold and maintain Angular applications
To install the Angular CLI:
npm install -g @angular/cli
Generating and serving an Angular project via a development server Create and run a new project:
ng new my-project
cd new-project
ng serve
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
All builds make use of bundling, and using the --prod
flag in ng build --prod
or ng serve --prod
will also make use of uglifying and tree-shaking functionality.
ng test
Tests will execute after a build is executed via Karma, and it will automatically watch your files for changes. You can run tests a single time via --watch=false
or --single-run
.
ng e2e
Before running the tests make sure you are serving the app via ng serve
.
End-to-end tests are run via Protractor.
There are several stories which will walk you through setting up additional aspects of Angular applciations.