Difference between AngularJS and Angular 2

To know the more benefits of Angular 2 in detail, you can go through the below link,

Difference between Angular 2 and Angular 4

We know that Angular 2 is completely rewritten from scratch, there is no match between AngularJS and Angular 2. From the developer standpoint, Angular 2 is a complete rewrite from AngularJS and moving from AngularJS to Angular 2 is a complete change. From the developer standpoint, it is learning two different frameworks.
In Angular 2 we were writing like,
  1. <div *ngIf="yourCondition">
  2. <h2>Condition true!</h2>
  3. </div>
  4. <div *ngIf="!yourCondition">
  5. <h2>Condition false!</h2>
  6. </div>
Now you can rewrite the same in Angular 4,
  1. <div *ngIf="yourCondition; else myFalsyTemplate">
  2. <h2>Condition true!</h2>
  3. </div>
  4. <ng-template #myFalsyTemplate>
  5. <h2>Condition false!</h2>
  6. </ng-template>

What is new in Angular 5?

The Angular 5 is released on 1st November 2017.
If you want to restrict them only for TestComponent then below is the sample code,
  1. @Component({
  2. templateUrl: 'test.component.html',
  3. preserveWhitespaces: false
  4. }
  5. export class TestComponent {}
If you want to restrict them throughout the application level then we have add the below lines of code in tsconfig.json file.
  1. "angularCompilerOptions": {
  2. "preserveWhitespaces": false
  3. }
Before,
  1. Component({
  2. provider: [{
  3. provide: 'my-service',
  4. useValue: testMethod()
  5. }]
  6. })
  7. export class CustomClass {}
Now in Angular 5,
  1. Component({
  2. provider: [{
  3. provide: ''
  4. my - service ', useFactory: () => null}]
  5. })
  6. export class CustomClass {}
Recently Angular 6.0.0-beta.3 got released on 7th Feb 2018. You can find the entire release cycle of Angular at the following link.
I would appreciate your valuable feedback. Happy reading :)