Angular 7 is barely out and version 7.1 has created fresh excitement and anticipation among the developers. Apart from the bugs of the earlier version that would be fixed with 7.1, the talks are about the new features that are about to simplify an Angular coder’s life.
Here’s a sneak peek into what these features are.
With the Angular 7.1, the canActivate guard can return an URLTree instead of a Boolean or a value that will eventually return a Boolean. This means your user is instantly directed to the router that will direct the user to the same URL even if different redirects happen through various guards.
Inclusion of Bazel:
A@angular/bazel is published on NPM with a target bazel-workspace. With the scalable, fast and multi-language build system built into the Angular repository, users can now experiment with building Angular CLI applications using Bazel build.
Up until now the runGuardsAndRevolvers would run when a path or a matrix parameter along a route changed. One could also use the paramsOrQueryParamsChange to define a change if a particular parameter changed or set an option to always trigger a change if any of the parameters changed.
With the new 7.1, there’s a new option with pathParamsChange that can be used to trigger the guards and revolvers when only a path changes, that might not necessarily mean a change in the parameters.
UpdateOn in FormBuilder:
Angular 5 made way for update modes in template-driven and reactive forms through the UpdateOn option in FormGroups. The UpdateOn could be used via the constructor option on FormGroups. With the new version, it can be used in FormBuilder through the group helper option. This makes the API more consistent and logical. The syntax remains the same as it would be in case of FormGroup.
Notification with SwPush:
It’s now possible to be notified when a user clicks on a push notification, via the notificationClicks available with @angular/serviceworker package. This feature is certainly in the right direction in the age of digital marketing and customer service.
The Ivy update could easily be the much anticipated one of the lot as far as the developers are concerned. And, that’s because Ivy is already a favourite since it, as opposed to the previous compilers, shrunk the unused codes automatically and also compiled each file separately.
The Ivy renderer in Angular 7.1 makes debugging even faster. Public discovery utilities are now added to help debug the application in the browser. For instance, a user can analyse an element and store an element in a browser and with the help of the newly added functions have the associated component returned. The browser console now boasts of functions like getDirectives(target), getComponent(target), getInjector(target), getHostComponent(target), getRootComponents(target), and getPlayers(target).
Get in touch with our experts at Suyati to know more about Angular 7.1 release.