Deprecations in Angular v15
Angular v15 also marks certain features for deprecation, which indicates it will not be usable in future.
- DATE_PIPE_DEFAULT_TIMEZONE: This is replaced by
DATE_PIPE_DEFAULT_OPTIONS
, where the timezone field inDATE_PIPE_DEFAULT_OPTIONS
defines the time zone. - Injector.get() with InjectFlags parameter: This should now be used with the
InjectOptions
object instead. - TestBed.inject() with InjectFlags parameter: Similarly, use
TestBed.inject()
with theInjectOptions
object. - providedIn: NgModule for @Injectable and InjectionToken: The usage of
providedIn: NgModule
orprovidedIn: 'any'
for an@Injectable
orInjectionToken
is being deprecated. Instead, consider usingprovidedIn: 'root'
, or if providers must be scoped to a specific NgModule, useNgModule.providers
instead. - RouterLinkWithHref directive: This directive is being replaced by the
RouterLink
directive, which now includes the functionality ofRouterLinkWithHref
.
Angular 15
Angular, the popular JavaScript framework, continues its journey of updation with the release of version 15, bringing some new improvements, and new features, as well as some breaking changes and deprecations. In this article, we’ll explore the key highlights of updating your Angular applications to version 15.
Table of Content
- What’s new in Angular 15?
- Major Changes in Angular v15
- Deprecations in Angular v15
- Upgrade from Angular v14 to Angular v15
- Conclusion