What this article is about
Angular 22 introduces the @service() decorator as a simpler replacement for @Injectable(). This article covers what the new decorator does, how it differs from the old approach, and whether you should migrate your existing services. It also covers template comments, another new feature landing in version 22.
Hi, my name is Tom Smykowski, I'm a staff full-stack engineer. I build and scale SaaS platforms to millions of users, working end-to-end from system architecture to frontend to mobile. On this blog I share Angular updates and framework evolution insights.
Questions this article answers
- What does the new
@service()decorator do in Angular 22? - How is
@service()different from@Injectable()? - What is the
autoProvidedproperty and when would you use it? - Can you add comments inside HTML element tags in Angular templates now?
- Should you migrate existing services to the new decorator?
Article size and reading time
This article is approximately 1,200 words and takes about 5 minutes to read. It includes code examples for both the old and new decorator syntax, plus a look at the new template comment feature.
