Angular 2, 4, 5, 6
What is Angular?
It supports most of Object-Oriented Programming (OOPs) features though some of them may be in different ways/fashion. We can have classes and objects, constructors, access modifiers, dependency injection, services-based communications etc.
Is Angular a stand-alone web-development framework like asp.net forms, MVC, etc.?
Yes, Angular framework is just like other development frameworks that enables you to build web application in it. Though if you want to integrate it with other frameworks like .net MVC you can do that.
What are important building blocks of Angular?
Below are important building blocks of Angular: -
- Modules (a group of related components, directives, services, pipes etc.; In simple terms, it is a class decorated with @NgModule)
- Component (a smaller part/block of application; TypeScript is used to write the logic for showing data on HTML. A single web page can be build of many components.)
- Template (a blueprint or structure; Easy for plotting data; Written in HTML)
- Directives (behavior of DOM element)
- Data Bindings
- Dependency Injection
How to start?
It is very easy to start working in Angular. Below are simple steps to setup the environment and then follow the conventions of Angular 😊
- Development Environment Setup
- Create a "Hello World!" Angular Project
- Build and Run the "Hello World!" Project
Step 1: Development Environment Setup
1.(a) Installation of npm and node.js
Here, we just need to install node.js. as it automatically installs npm (nuget package manager) along with it. NPM is used as a package manager. To just make sure the installation is success and version detail, we can run following commands at comman prompt: -
1.(b) Installation of Angular CLI
Once the npm is available, we can use it to install Angular CLI by running below command at command-prompt-
npm install -g @angular/cli
Step 2: Create a Hello World! Project
It is very easy to create a Angular project using CLI command. Just run the below command –
ng new ProjectName
It will take some time to create the project-
Step 3: Build and Run the Hello World! project
ng new command creates a project, brings all dependencies to it. To build this, we need to go into the directory created with the same name of project.
to Run the project, type-
ng server -o
The above command line command will build the application, run it. -o parameter opens yours default browser like -