Building Angular Applications
below steps are for creating angular Application
- Downloading and installing Node.js and npm
- Install Angular CLI
- Create an app with Angular CLI
- Build & Open the application
1. Downloading and installing Node.js and npm
Angular required node.js, we need to download NPM(Node Package Manager).
we can download it from here- https://nodejs.org/en/
Once you have installed Node.js, you can use the npm command to install TypeScript, open command prompt & type this below command-
we can download it from here- https://nodejs.org/en/
Once you have installed Node.js, you can use the npm command to install TypeScript, open command prompt & type this below command-
npm install npm –g
it will install all packages globally.
once you have done it. you can check which node version installed in your machine.
g
stand for global
.once you have done it. you can check which node version installed in your machine.
node -v
2. Install Angular CLI
To install Angular CLI, run
$ npm install -g @angular/cli
This will install the ng command globally on your system. ng stands for Angular.
check angular CLI version with help below command
check angular CLI version with help below command
ng v
3.Create an app with Angular CLI
now we can create an angular project with the help of below command
ng new my-first-angular-app
once you run this above command it will ask for router configuration.
If you say “Yes” then CLI will automatically add router configuration to your project.
it will installed/include all related files inside project directory.
If you say “Yes” then CLI will automatically add router configuration to your project.
it will installed/include all related files inside project directory.
Angular App Structure
once you have created project these files will be included.
4.Build & Open the application
To build & open Application you need to run below command
ng serve --open
once you run this command project will build & open in your local machine.
The server automatically rebuilds the app and reloads the page when you change any of the source files.
Comments
Post a Comment