Google released the new version of the Angular Framework, Angular 15, on November 16, 2022. In this version, the main focus is Stability. In this article, you will discover the latest features of Angular. Before that, let’s understand what Angular is.

What is Angular?

Angular is a popular framework that developers use to create Single-page Web Applications (SPAs) operated using TypeScript and HTML. Angular is written using TypeScript, using a collection of TypeScript that integrate into applications; it implements both essential and optional functionality. Developers must be well versed with the Angular platform as it is an opinionated framework that specifies specific rules and standards which must be followed while creating apps. 

Components are the basic unit of Angular. These are defined as Modules. NgModules’ purpose is to build functional sets established by various codings. Angular mainly works on data and logic.

What is new in Angular 15?

The new version of Angular 15 has been released to increase efficiency for developers. Angular releases a new update every six months. 

Angular 15 is updated to support and increase Stability in the Angular framework. The most notable change is the Standalone components, and this feature makes the entire process easy for developers, who can now develop applications without using modules.

Features of Angular 15

The Angular 15 upgrade introduced several new improvements, including Stability and expanded supportability, which promise to deliver improved developer experience and performance. The features must be understood to understand how this version increased the Stability of the Angular Framework.

Standalone APIs

Standalone APIs were introduced in the Angular 14 version for developers to develop Angular applications without any requirements of Ng models. Because of the reliable API library, developers no longer have to worry about continuously evaluating the fundamental component, which speeds up and makes development more straightforward.

In the Angular 15 version, after careful performance observation and modifications, the standalone components API finally reaches its level of Stability. The standalone component feature is no longer in “Developer Preview” mode. Thus, the new Angular 15 version includes stable and reliable application creation methods.

Developers can now create Angular applications without using any modules, thanks to Angular 15. With this version, Standalone APIs can function flawlessly throughout Angular with its elements, HttpClient, and other applications.

Directive Composition API

The directive composition API is another feature of Angular 15. Developers can add directives to host components using the directive composition API, giving Angular a practical approach to code reuse. The most requested feature on GitHub, to apply directives to a host element, served as the basis for this functionality. However, this feature only functions with Standalone Directives.

Solid Image Directives

The experience of using the internet depends heavily on images. If web images load quickly, users will be happy with the experience, and your website will make more money. The Angular team chose to work together on image directives for Angular to improve fundamental web essential metrics and provide a better user experience. 

The solid image directive feature is estimated to improve Angular 15’s quality by up to 75%. With Angular 15, the image directive capability is now highly stable. One of the most popular websites, Lands’ End, added this function and saw improvements in LCP (Largest Contentful Paint) of approximately 75%.

This can be used directly in the Angular component. Substitute the image src attribute with ngSrc when utilizing this Angular image directive within a component, making sure to specify the priority attribute to maximize the performance for the LCP images. 

Angular 15 also provides an upgrade to the image warnings, a shorter download time due to an automated srcset directive, and an experimental fill mode.

Stable MDC-Based Components

The Angular team put a lot of effort into refactoring its component based on the Angular Material Design Components for the web apps to increase the reliability of the Angular materials. This was done to provide a better alignment to the Material Design specification and embrace Material 3 component styles (MDC). These components have also been improved to provide better accessibility and compliance with the Angular Material Design Specifications.

The DOM and CSS components have majorly been refactored in this case. Some styles in the previous Angular applications will need to be adjusted due to the new responsiveness update, particularly in the case of CSS overriding internal elements of the migrated components.

In the recent Angular 15 version, older implementations are no longer supported. Because of this, developers can restore them by utilizing the “legacy” import.

Improved Debugging and Strack Traces

With the Angular 15 upgrade, stack traces have made Angular application debugging easier, more precise, and more straightforward. The Angular development team made sure to meet a standard allowing more in-depth code analysis than just displaying the libraries it uses. 

The error messages can now benefit from some changes thanks to this accomplishment. Angular 15 now provides more understandable stack errors. Instead of presenting issues from third-party dependencies, the version now displays code-focused error messages. The community incorporated those third-party dependencies (with the aid of node modules, zone.js, etc.) and created linked stack traces due to extensive collaboration with the Angular and Chrome DevTool teams.

CDK Listbox

The Component Dev Kit, or CDK, is a set of several action primitives that facilitates the creation of UI components. Developers can use a new primitive called CDK Listbox, available in Angular 15, to alter the WAI-ARIA Listbox pattern’s planned Listbox interactions to meet their own requirements. 

It combines host components and ARIA responsibilities. The Listbox component development kit includes unique elements, such as attention management, keyboard interactivity, and bidi layout.

Depending on the unique WAI-ARIA pattern of the Listbox, @angular/CDK/Listbox offers directives to help you construct Listbox interactions. 

Other Developments

Node Versions

In favor of 14.40, 16.13, and 18.10, Angular will stop supporting node.js versions older than 14. [15-19] and 16. [10-12].

The most recent version of Angular will no longer support Typescript versions older than 4.8 and will remove the ability to define relativeLinkResolution in the router.

Improved Efficiency

The latest version of Angular enables a comfortable build.

Enhanced Angular Components

Various accessibility improvements are included in the Angular 15 components’ release, such as effective contrast ratios, increased touch target sizes, and improved ARIA semantics. Furthermore, for a better experience customizing themes, Angular components can have their own APIs to adjust their density.

Lazy Loading

A lazy loading technique loads non-critical resources on the pages only when they are needed. This helpful feature from Angular makes lazy loading simpler.

Usually, when you load a component or child in an angular route, you have to choose what to load; however, with the most recent updates, it now considers default exports and loads only what is necessary.

Quick Fix

You can now create your Angular code with more assurance by making the most of the language service. Using this functionality, you can automatically import template components and their fixes that aren’t utilized in standalone components or NgModules.

Deprecation of Protractor

Based on community opinion in the Angular 15 version, the Angular team decided to deprecate the Protractor, which will expire during the summer of 2023, since JavaScript’s environment and standard have improved, bringing newer syntax and more effective development tools. 

The Protractor must make the user rewrite the tests to utilize such changes. It will no longer be significant to Angular because it was created initially to support Angularjs-specific functionality.

Additional end-to-end testing options, such as Cypress, Nightwatch, and WebdriverIO, can be employed for Angular projects.

CSS Keyframes

The CSS keyframes had a problem, and there was no sign that it was a component scoped. The angular team has been tackling this problem since 2019, and with Angular 15, they have developed a long-term solution.

In Angular 15, the keyframe names are component scoped, therefore, if the same keyframe names are used throughout the app, rendering and component definitions will not collide. The Angular team solved this long-standing problem by impersonating the keyframe name in the host component selector.

Suppose the code depends on the keyframe’s global aspect; this change may cause it to malfunction. This must then be added to the global stylesheet in such a situation. 

Debugging Improvement

When dealing with complex codes, software developers and engineers must often use stack tracing to identify programme flaws. Therefore, enhancing zone.js’ debugging capabilities will make it simpler for developers to find errors.

Mistyped Banana in a box

The mistyped Banana in a Box repair has been improved with an intriguing new capability introduced in Angular 15. The syntax for two-way data binding in Angular templates is “banana in a box.” You can shorten the syntax by using the Banana in a box.

Developers sometimes write the parenthesis, i.e., the Banana, and the square, i.e., the box, in the wrong sequence. It is written in the wrong order by putting parentheses outside the box ([]); this will lead to many errors.

Therefore, the most recent angular updates will note such problems and provide a solution through language services.

Summary: 

Angular stands as one of the best open-source web application frameworks. The Angular development team is constantly working towards fulfilling the community’s requirements.