How To Create New Project In Angular
In this article we Installing and Setting Up an Angular Development Environment and create first angular project.
What is Angular CLI:
The Angular CLI allows us to article create an Angular application that includes all of the necessary configuration files and packages in a single command. It also makes it easier to add new functionality to existing Angular applications (components, directives, services, and so on).
The Angular CLI leverages Typescript, Webpack (for module bundling), Karma (for unit testing), and Protractor to produce the Angular Application ( for an end to end testing).
How to Create a new Angular project:
You must first set up your developer environment and install the necessary tools before you can begin working with Angular. Install the following before starting.
- Visual Studio Code (or any other editor of your choice)
- NPM Package Manager
Installing Angular CLI:
The first step is to download and install the Angular CLI. We use the npm install command.
npm install -g @angular/cli@latest
Check the Angular CLI Version:
ng --version
Create a new Angular Application:
ng new Angular-Demo
- This command creates a new directory. Angular-Demo was developed.
- Creates the application's folder structure.
- Installs the Angular libraries as well as any other requirements.
- Installs and sets up TypeScript
- Installs and sets up Testing using Karma and Protractor
Now, Run your new Angular Project
ng serve
Angular project Folder structure:
├── e2e
│ ├── src
│ │ ├── app.e2e-spec.ts
│ │ ├── app.po.ts
│ ├── protractor.conf.js
│ ├── tsconfig.e2e.json
├── node_modules
├── src
│ ├── app
│ │ ├── app-routing.module.ts
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ ├── assets
│ │ ├── .gitkeep
│ ├── environments
│ │ ├── environment.prod.ts
│ │ ├── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles.css
│ ├── test.ts
├── .editorconfig
├── .gitignore
├── angular.json
│── browserslist
├── karma.conf.js
├── package-lock.json
├── package.json
├── README.md
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
└── tslint.json