Start Building
Development prerequisites
Install Node.js and NPM : Download Node.js from https://nodejs.org/en/download/ and install it on your system. NPM comes bundled with Node.js
angular-cli : Install angular-cli by executing
npm install -g @angular/clicommand on your your terminal or command prompt. For more details visit https://github.com/angular/angular-cliInstall npm packages : In terminal go to your project root directory and run
npm installcommand, it will download all the dependencies under node_modules folder.
Running development server
Run ng serve command to run dev server and access http://localhost:4200/ to run your app/project on browser. The app will automatically reload if you change any of the source files.
As ng serve runs watch command which detects any change in project files so it will automatically reload your app on browser if you make changes in files.
Production building
Run ng build to build the project. The build will be stored in the dist/ directory. Use the -prod flag for a production build. Use --aot flag for a AoT build for example : ng build --prod --aot
Further help
To get more help on the angular-cli use ng --help or go check out https://github.com/angular/angular-cli
Last updated
Was this helpful?