Angular is one of the best frameworks in front-end development. Angular uses typescript to build the client-side code and TypeScript is a superset of JavaScript.
New Features in Angular 10:
- Language Service
- New Default Browser Configuration
- Warning about CommonJS imports
- Optional Stricter Settings
- Typescript 3.9
- Default bundle budgets drop to 75%
If you want to know about Angular 10 features, please feel free to visit Angular 10 Features & Updates.
Angular development using the Angular CLI tool. In order to install Angular CLI, we need to install nodejs first.
Prerequisites
- Node Js (latest version) - nodejs download
- Angular CLI
- Prior knowledge of Typescript
Step 1: Install Angular CLI 10
Angular CLI is used to initialize, develop, and maintain Angular applications. It uses the command line.
Open Powershell terminal or command prompt and enter the below line to install the Angular CLI,
$ npm install -g @angular/cli
Once the Angular CLI is installed, at the end you can see the @angular/[email protected] on your terminal.
Now you are good to go to create your first Angular 10 app.
Step 2: Create your first Angular 10 project
We use Angular CLI to create our Angular project. Open Powershell terminal or command prompt,
$ ng new sample-app
When enter the above command the Angular CLI will prompt you and will ask whether you want to add Angular routing or not. Next, it will ask you which stylesheet format you want tp add. Once you enter proper response then Angular CLI will create the folders and files, install the packages for our project.
Once the angular project/app is created, you will see the below folder structure and files, (i.e., app component Html, scss and typescript files),
Step 3: Run Angular Application
Use below command to compile and run the angular application, Go to your projects root folder (i.e., sample-app) and run the ng serve
command
$ cd sample-app
$ ng serve
The Angular application will be available in this http://localhost:4200/
URL/address.
If you use ng serve --open
, it will automatically open your application in the browser using http://localhost:4200/
address/URL. OR you have to open browser manually enter http://localhost:4200/
address, then you will see the below page,
Comments (0)