What is Angular?
Angular is an open-source and TypeScript-based platform and framework for building client-side web applications as Single Page Applications
Angular version history
Separate terms should be used for each framework with "AngularJS" referring to the 1.X versions and "Angular" without the "JS" referring to versions 2 and up.
Why do we need Angular?
Benefits of Using Angular
Architecture of Angular
Main building blocks of an Angular Application
Angular Module (NgModules)
Angular Module (NgModules)
// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [ AppComponent ],
imports: [ BrowserModule, AppRoutingModule ],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Angular Components
Angular Components
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'angular7-router-demo';
}
Angular Templates
{{2 | power: 5}}
Angular Metadata
// app.component.ts
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
Metadata can be attached to the TypeScript using the decorator. @Component is a decorator which makes use of configuration object to create the component and its view.
Angular Data building
Data building is communication between business logic and views.
There are four forms of data binding and they differ in the way the data is flowing.
Angular Directives
Angular services
Dependency Injection (DI)
Together a component and template define an Angular view.