Tonight, on October 15, 2024, I’ve been diving into an article written by Alex Rickabaugh on blog.angular.dev regarding the roadmap for Angular 19.
The Future is Standalone!
Of course, the "future" being discussed here is the evolution of Angular itself. For those who might not be aware, Angular introduced the concept of Standalone components starting around version 14 and made them the default in version 18.
In versions 14 through 18, we still had to explicitly add the standalone: true flag. However, in version 19, this will no longer be necessary. If the Angular CLI generates a component file without that flag, don't worry—Angular 19 will treat it as a standalone component by default.
Currently, it looks like this:
@Component({
standalone: true,
imports: [UserAvatarComponent, AccountListComponent, FormsModule],
selector: 'user-profile',
template: './user-profile-component.html',
})
export class UserProfileComponent {…}
In the future (v19), it will look like this:
@Component({
imports: [UserAvatarComponent, AccountListComponent, FormsModule],
selector: 'user-profile',
template: './user-profile-component.html',
})
export class UserProfileComponent {…}
The only catch is if you are still using NgModules in Angular 19; in that case, you will have to explicitly set the flag to standalone: false.
