- 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-cli
- Install 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
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.
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.
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
To get more help on the
ng --help or go check out https://github.com/angular/angular-cli