- Install NPM. You can follow the steps here. Â
- Install angular-cli using NPM.
npm install -g angular-cli. Linux users will want to run this command withsudo. - Create a new Angular 2 project.
ng new PROJECT_NAME. (This will probably take a few minutes.)
ng serve, angular-cli will compile your project and start serving it. In the output, youâll see the address your application is getting served at.
** NG Live Development Server is running on http://localhost:4200. **
For me, it is serving at http://localhost:4200. Going to that address shows me my working Angular 2 app! Â

angular-cli.json
karma.conf.js
package.json
protractor.conf.js
README.md
tslint.json
src
favicon.ico
index.html
main.ts
polyfills.ts
styles.css
test.ts
tsconfig.json
typings.d.ts
app
app.component.css
app.component.html
app.component.spec.ts
app.component.ts
index.ts
shared
assets
environments
environments.prod.ts
environments.ts
e2e
app.e2e-spec.ts
app.po.ts
tsconfig.json
node_modules
... dependencies
That still seems like a lot to digest right away. The good news is that you can jump into src/app/ and start editing the app directly. In that directory you will see a module file, app.module.ts. You can read more about modules here. Youâll also see four files that make up your first component, app.component.css, app.component.html, app.component.spec.ts, and app.component.ts. These four files define your component's css styles, html template, tests, and typescript logic respectively. When you add a class to your css,
.blue {
color: blue;
}
and subsequently add that class to your html template,
<h1 class="blue">
{{title}}
</h1>
youâll notice that your app is now blue!

