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/cliAfter 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 AngularAppIn 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 serveOn 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
--prodFlag to set configuration to “prod”.
configuration
--configuration (alias: -c)Specify the configuration to use.
browser-target
--browser-targetTarget to serve.
port
--portPort to listen on.
host
--hostHost to listen on.
proxy-config
--proxy-configProxy configuration file.
ssl
--sslServe using HTTPS.
ssl-key
--ssl-keySSL key to use for serving HTTPS.
ssl-cert
--ssl-certSSL certificate to use for serving HTTPS.
open
--open (alias: -o)Opens the url in default browser.
live-reload
--live-reloadWhether to reload the page on change, using live-reload.
public-host
--public-hostSpecify the URL that the browser client will use.
serve-path
--serve-pathThe pathname where the app will be served.
disable-host-check
--disable-host-checkDon’t verify connected clients are part of allowed hosts.
hmr
--hmrEnable hot module replacement.
watch
--watchRebuild on change.
hmr-warning
--hmr-warningShow a warning when the –hmr option is enabled.
serve-path-default-warning
--serve-path-default-warningShow a warning when deploy-url/base-href use unsupported serve path values.
optimization
--optimizationDefines the optimization level of the build.
aot
--aotBuild using Ahead of Time compilation.
source-map
--source-mapOutput sourcemaps.
eval-source-map
--eval-source-mapOutput in-file eval sourcemaps.
vendor-chunk
--vendor-chunkUse a separate bundle containing only vendor libraries.
common-chunk
--common-chunkUse a separate bundle containing code used across multiple bundles.
base-href
--base-hrefBase url for the application being built.
deploy-url
--deploy-urlURL where files will be deployed.
verbose
--verboseAdds more details to output logging.
progress
--progressLog progress to the console while building.