How TO Angular 5 CLI Install on Weindows and new project | cmd Install | jode.js |visual studio code
Installation
BEFORE YOU INSTALL: please read the prerequisites
npm install -g @angular/cli
Usage
ng help
Generating and serving an Angular project via a development server
ng new PROJECT-NAME
cd PROJECT-NAME
ng serve --open
Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
You can configure the default HTTP host and port used by the development server with two command-line options :
ng serve --host 0.0.0.0 --port 4201
github : https://github.com/angular/angular-cli
mainwebsite: https://cli.angular.io/
ng new
The Angular CLI makes it easy to create an application that already works, right out of the box. It already follows our best practices!
ng generate
Generate components, routes, services and pipes with a simple command. The CLI will also create simple test shells for all of these.
ng serve
Easily test your app locally while developing.
Test, Lint, Format
Make your code really shine. Run your unittests or your end-to-end tests with the breeze of a command. Execute the official Angular linter and run clang format.
ng build
Creating a build
ng build
The build artifacts will be stored in the dist/ directory.
All commands that build or serve your project, ng build/serve/e2e, will delete the output directory (dist/ by default). This can be disabled via the --no-delete-output-path (or --delete-output-path=false) flag.
Build Targets and Environment Files
ng build can specify both a build target (--target=production or --target=development) and an environment file to be used with that build (--environment=dev or --environment=prod). By default, the development build target and environment are used.
These options also apply to the serve command. If you do not pass a value for environment, it will default to dev for development and prod for production.
these are equivalent
ng build --target=production --environment=prod
ng build --prod --env=prod
ng build --prod
and so are these
ng build --target=development --environment=dev
ng build --dev --e=dev
ng build --dev
ng build