How to Create Angular Application

Install Node JS

First of all install Node JS in your machine. You can download Node JS from here.

Install Angular CLI

Next open terminal or CMD and run the below command

npm install -g @angular/cli

After completing this process you can create an Angular Application by following instruction

Creating Angular Application

Next we need to open terminal or CMD in your directory which you need to create application and then run the following command

ng new AngularApp

In the above command the "AngularApp" is the angular application name. It can be change to other name. That's it !!

Running Angular Application

You can run angular application using the following commands

ng serve

On serving or running angular application we have more parameters can pass means with the use of running parameters we can run the application in any host or port etc. Thus are the Angular CLI parameters for running Angular application

prod

--prod

Flag to set configuration to “prod”.

configuration

--configuration (alias: -c)

Specify the configuration to use.

browser-target

--browser-target

Target to serve.

port

--port

Port to listen on.

host

--host

Host to listen on.

proxy-config

--proxy-config

Proxy configuration file.

ssl

--ssl

Serve using HTTPS.

ssl-key

--ssl-key

SSL key to use for serving HTTPS.

ssl-cert

--ssl-cert

SSL certificate to use for serving HTTPS.

open

--open (alias: -o)

Opens the url in default browser.

live-reload

--live-reload

Whether to reload the page on change, using live-reload.

public-host

--public-host

Specify the URL that the browser client will use.

serve-path

--serve-path

The pathname where the app will be served.

disable-host-check

--disable-host-check

Don’t verify connected clients are part of allowed hosts.

hmr

--hmr

Enable hot module replacement.

watch

--watch

Rebuild on change.

hmr-warning

--hmr-warning

Show a warning when the –hmr option is enabled.

serve-path-default-warning

--serve-path-default-warning

Show a warning when deploy-url/base-href use unsupported serve path values.

optimization

--optimization

Defines the optimization level of the build.

aot

--aot

Build using Ahead of Time compilation.

source-map

--source-map

Output sourcemaps.

eval-source-map

--eval-source-map

Output in-file eval sourcemaps.

vendor-chunk

--vendor-chunk

Use a separate bundle containing only vendor libraries.

common-chunk

--common-chunk

Use a separate bundle containing code used across multiple bundles.

base-href

--base-href

Base url for the application being built.

deploy-url

--deploy-url

URL where files will be deployed.

verbose

--verbose

Adds more details to output logging.

progress

--progress

Log progress to the console while building.