How
to Setup for local development?
Before you start Angular 7, make sure your
development environment includes following.
1.
Node.js® and
2.
npm package manager
Node.js
-
For Angular 7,
requires Node.js version 8.x or 10.x.
Firstly check your Node.js version, run the below
commands in your console window -
> node -v
For installing Node.js, go to nodejs.org
NPM
Package Manager -
For npm package manager, go to https://docs.npmjs.com/getting-started/what-is-npm
For Quick Start uses the npm client command line
interface, go to https://docs.npmjs.com/cli/install
Step
1
- Install the Angular CLI
>
npm install -g @angular/cli
Step
2-
Create a Angular application by using CLI command
>
ng new demoApp
Here demoApp is my application name.
Step
3
- Serve the application
>
cd demoApp
>
ng serve --open
The Result looks like -
Example looks like -
import {
Component } from '@angular/core';
@Component({
selector: 'my-demoApp',
template: `<h1>Welcome to my first {{name}}</h1>`
})
export class AppComponent { name = 'Angular 7 App!'; }