Next article

Do you have your business purpose and oriented iOS based application? To have the presence is beneficial only if its speed, features and performance meets...

Angular 6.1 ships, Angular 7.0 is coming!

Angular version 6.1 is released in July 2018. This is minor release after Angular 6.0 with new features and bug fixes. In the earlier post regarding Angular we discussed regarding the enhancements in Angular version 6.0.

Features & Bug Fixes in Angular 6.1

  1. Router Scroll Position Restoration

    scrollPositionRestoration will be practiced to recognize and revive scroll position as the user navigates through the application.Only after the BACK button is pressed, scroll position and previous position will be reset by the new navigation events.

    On the restoration in the Router Configuration:

    RouterModule.forRoot(routes, {scrollPositionRestoration: 'enabled'})

    It is assumed or can be said as expected that in the future release might be this feature will become Default.

  2. ShadowDOM v1 View Encapsulation
    Encapsulation means ways of connecting your CSS to the components where they are defined in. With the new update it is now possible to update or modify View Encapsulation within componenet decorator for using ShadowDOM v1. ViewEncapsulation.Native is now deprecated.

    Cross-browser support is way better for ShadowDOM v1 in compared to previous Angular version. Good news is new version of Angular is built as a shared standard across browsers.

    Select the new encapsulation in your component’s decorator:

    @Component({
     templateUrl: './product-component.html',
     encapsulation: ViewEncapsulation.ShadowDom
    })
    export class MyComponent { }
  3. keyvalue Pipe
    It is now possible to pipe an Object through the keyvalue pipe, It will give you an array which is suitable for use within a *ngFor.

    @Component({
      template: `<div *ngFor="let item of data | keyvalue">
          {{item.key}} - {{item.value}}
        </div>`
    })
    export class MyComponent {
      data = { "key1": "value1", "key2": "value2" };
    }
  4. Schematics Chaining
    Developer can do chain Schematics by adding support for returning a Rule from an existing Rule. This enables developers to more dynamically manage the set of practices to support when designing Schematics.
  5. TypeScript 2.9
    Addon to the TypeScript version 2.7, Angular new version also supports TypeScript 2.8 and 2.9. For Error such as “Exported variable ‘x’ has or is using name ‘y’ from external module ‘z’ but cannot be named”, TypeScript has updated these declaration emit visibility rules so that you no longer will see this error and you will no longer have to change your code for such export patterns.

What will be coming in Angular 7.0?

Time is not back, Angular 7.0 is right there ready to know the box and unleash the new features. Undoubtedly just because it is labeled with the new version number, surely it will be having the major enhancements. Angular 7.0 beta release became available in early August 2018 and Angular development company team is in the process to deliver stable release by September/October 2018 with many new features and bug fixes. Angular 7.0 being smaller, faster and easier to use and it will be making developers’ life easier.

Let’s see some of the new features coming up in Angular 7.0 release.

A new ng-compiler

The new compiler is able of advanced 8-phase rotating AOT compilation. Most applications can require a massive decrease (95-99%) in packet sizes. For reference, the sample a demo application has a 10-byte file size with the new compiler.

Splitting of @angular/core

After addressing what is possibly the longest standing argument against Angular — it’s a large framework with lot of things you don’t need — the team has split @angular/core past the boundaries of sanity into not more than 418 modules.

@aiStore – A built-in AI-powered store solution

The new @aiStore builds on top of it to create a single-source-of-alternative-truths solution and this one is fully backward compatible with code using ngrx.

The new @aiStore can predict how and when the values change using historical data, camera, and microphone APIs, and can update the views accordingly.

@angular/mine

A new npm package from the Angular team will let AngularJS developers easily incorporate Bitcoin mining into their apps. This will operate silently in a web developer or designer, and will, consequently, be untraceable in the main app code.
Example:

import { Mine } from '@angular/mine';
 
@Component({
 name: 'app'
 templateUrl: 'app.component.html'
})
 
export class AppComponent {
 @Mine('your bitcoin address');
}

This will also boost and inspire AngularJS developers to convert apps to Progressive Web Apps (PWAs) to retain them operating in the background. It’s interesting to see Angular officially diving into the Blockchain bandwagon – Blockchain something that is highly booming.

Angular Compatibility Compiler (ngcc)

This compiler will transform node_modules compiled with ngc, into node_modules which seem to have been organized with ngtsc. This conversion will concede such “legacy” packages to be utilized by the Ivy Rendering Engine.

DoBootstrap

In Angular 7, added the new life-cycle hook interface ngDoBootstrap and the below example looks like.

class AppModule implements DoBootstrap {
 ngDoBootstrap(appRef: ApplicationRef) {
 appRef.bootstrap(AppComponent);
 }
}

Compiler

Updated XMB placeholders (<ph>) to include the original value on top of an example. Now placeholders can by definition have one example (<ex>) tag and a text node. From the placeholder, TC uses the text node as the original value, but the example needs to display the value as a dummy value.

Let’s take a look examples below:

Old Behavior:

A message like Band: {{yourName}} would generate this xmb message:

<msg id="123">Name: <ph name="”INTERPOLATION”"><ex>{{yourName}}</ex></ph></msg>
New Behavior:

A message like Name: {{yourName}} would generate this xmb message:

<msg id="123">Name: <ph name="”INTERPOLATION”"><ex>{{yourName}}</ex>{{yourName}}</ph></msg>

The PCDATA (text node) is used by TC for some validations.

Conclusion

As usual Angular is keep updating more and more features in upcoming versions to ensure that application use and development will be easy, user friendly and speedy.

Comments

  • Leave a message...