Getting Started
Set up the Development Environment#
Nodejs#
Install Node.js® and npm if they are not already on your machine.
Warning
Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine..
Angular CLI#
The Angular CLI is a command line interface tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment.
Install:
1 | npm install -g @angular/cli |
Create a new project#
1 | ng new my-app |
Serve the application#
1 2 | cd my-app ng serve --open |
Note
Using the --open (or just -o) option will automatically open your browser on http://localhost:4200/
Project file review#
The src folder#
Your app lives in the src folder. All Angular components, templates, styles, images, and anything else your app needs go here. Any files outside of this folder are meant to support building your app. Link
The root folder#
The src/ folder is just one of the items inside the project's root folder. Other files help you build, test, maintain, document, and deploy the app. These files go in the root folder next to src/. Link
