Overview
Angular is an all-surround framework for JavaScript and based on typescript, that is habitually used by all developers throughout the world for building web, mobile, and desktop applications.
Versions of Angular :-
Version 1.0.0 :- released October 2010,
Version 2.0.0 :- released September 2014,
Version 4.0.0 :- released December 2016,
Version 5.0.0 :- released November 2017
Future Upcoming Version is 6.0.0 in March Or April 2018.
Also Angular 7.0.0 is coming in September 2018.
Speciality of Angular 5 :-
Angular 5 encompasses platform for a build optimizer, Simpler Progressive Web Applications, Angular Universal API and DOM and improvements related to Material Design.
Key attributes of Angular 5 :-
- Build optimizer
- Simpler Progressive Web Applications
- Improved compiler and Typescript
- CLI v1.5 will make Angular 5 Projects by default.
- New HttpClient
Example :-
import { HttpClientModule } from '@angular/common/http';
- Angular Universal API and DOM supported.
- Improved Material Design.
- Router Hooks
- Number, Dates and Currency Pipe Updates.
- Form Validation method change in Angular 5.
Example :-
<input name="Name" ngModel [ngModelOptions]="{updateOn: 'blur'}"> <form [ngFormOptions]="{updateOn: 'submit'}">
- Improvements in Compiler, because you can use benefits of running ng serve with the AOT flag turned on.
ng serve --aot
- Preserve Whitespace, it is defined in each component of decorator and by default is true.
@Component({ templateUrl: 'about.component.html', preserveWhitespaces: false } export class AboutComponent { }
Otherwise you can define in your tsconfig.json file, by default is true.
{ "extends": "../tsconfig.json", "angularCompilerOptions": { "preserveWhitespaces": false }, "exclude": [ "test.ts", "**/*.spec.ts" ] }
- New Router Lifecycle Events
Speciality of Angular 6 :-
Angular 6.0.0 beta Version has been released on March 2018 and Stable Version should be released in First Week of April 2018.
Angular beta Version is released with a lot of bug problems fixed and added new features and changes.
Important Key attributes of Angular 6 :-
- Bazel Compiler
- Ivy Renderer
- Closure Compiler
- Component Dev Kit (CDK)
- Service Worker
Syntax :-
(a)
ng generate universal <name>
(b)
ng build --app=
- Ng update and Schematics
- Updates in Animations,Forms and Router
- Add CDK stable Version
- Support of Native element
- 2.7+ Typescripts
- Decorator Error messages are improved.
- Changes in ngmodel
Example :- Previously ngmodel look like,
<input[(ngModel)]="firstname(ngModelChange)="onChange($event)>
And
onChange(value) { console.log(value); }
Now, It’s look like,
<input#modelDir="ngModel"[(ngModel)]="firstname"(ngModelChange)="onChange(modelDir)">
And
onChange(NgModel: NgModel) { console.log(NgModel.value); }
- In FormBuilder multiple Validators are added for array method
Example :-
bookForm: FormGroup; constructor(private formBuilder: FormBuilder) {} ngOnInit() { this.bookForm = this.formBuilder.group({ name: ['', Validators.required], options: this.formBuilder.array([], [MyValidators.correctname, MyValidators.totalCount]) }); }
Conclusion : –
That’s it ..
Angular 5 & Angular 6 is faster than earlier version, also size of applications are reduced and supported multiple names, directives and component which is useful to migrate without break changes.
It is more interesting.
Thank You..