Home
Pages 125
- Home
- 1 x angular cli
- 1 x build
- 1 x config
- 1 x doc
- 1 x e2e
- 1 x eject
- 1 x generate
- 1 x generate class
- 1 x generate component
- 1 x generate directive
- 1 x generate enum
- 1 x generate guard
- 1 x generate interface
- 1 x generate module
- 1 x generate pipe
- 1 x generate service
- 1 x home
- 1 x lint
- 1 x new
- 1 x serve
- 1 x stories
- 1 x stories 1.0 update
- 1 x stories application environments
- 1 x stories asset configuration
- 1 x stories autocompletion
- 1 x stories autoprefixer
- 1 x stories budgets
- 1 x stories code coverage
- 1 x stories configure hmr
- 1 x stories continuous integration
- 1 x stories css preprocessors
- 1 x stories disk serve
- 1 x stories github pages
- 1 x stories global lib
- 1 x stories global scripts
- 1 x stories global styles
- 1 x stories include angular flex
- 1 x stories include angular material
- 1 x stories include angularfire
- 1 x stories include bootstrap
- 1 x stories include font awesome
- 1 x stories internationalization
- 1 x stories linked library
- 1 x stories moving into the cli
- 1 x stories moving out of the cli
- 1 x stories multiple apps
- 1 x stories proxy
- 1 x stories routing
- 1 x stories third party lib
- 1 x stories universal rendering
- 1 x stories using corporate proxy
- 1 x test
- 1 x update
- 1 x xi18n
- add
- angular cli
- angular workspace
- build
- config
- DevHandbook
- doc
- e2e
- eject
- generate
- generate app shell
- generate application
- generate class
- generate component
- generate directive
- generate enum
- generate guard
- generate interface
- generate library
- generate module
- generate pipe
- generate service
- generate universal
- help
- LifeOfAFeature
- lint
- new
- run
- serve
- stories
- stories 1.0 update
- stories application environments
- stories asset configuration
- stories autocompletion
- stories autoprefixer
- stories budgets
- stories code coverage
- stories configure hmr
- stories continuous integration
- stories create library
- stories css preprocessors
- stories disk serve
- stories github pages
- stories global lib
- stories global scripts
- stories global styles
- stories include angular flex
- stories include angular material
- stories include angularfire
- stories include bootstrap
- stories include font awesome
- stories internationalization
- stories linked library
- stories moving into the cli
- stories moving out of the cli
- stories multiple apps
- stories multiple projects
- stories proxy
- stories rc update
- stories rc.0 update
- stories routing
- stories third party lib
- stories universal rendering
- stories using corporate proxy
- test
- update
- Upgrading from Beta.10 to Beta.12
- Upgrading from Beta.10 to Beta.14
- version
- xi18n
- Show 110 more pages…
Clone this wiki locally
Angular CLI
NOTE: this documentation is for Angular CLI 6. For Angular CLI 1.x go here instead.
Overview
The Angular CLI is a tool to initialize, develop, scaffold and maintain Angular applications
Getting Started
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 my-project
ng serve
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
Bundling
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.
Running unit tests
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
.
Running end-to-end tests
ng e2e
Before running the tests make sure you are serving the app via ng serve
.
End-to-end tests are run via Protractor.
Additional Commands
Angular CLI Workspace Schema
Additional Information
There are several stories which will walk you through setting up additional aspects of Angular applications.