Skip to content

feat: Angular 14 Standalone Components #25404

Description

@sean-perkins

Prerequisites

Describe the Feature Request

Angular 14 introduces the ability to use standalone components, without having to declare them on an NgModule. This feature is used for rendering components within a parent component, as well as for lazy loading a standalone component on a route, instead of using a routing module.

Standalone components encompass all declarations (pipes, directives and components).

As of Angular 14, standalone components are a dev preview feature. They are also not backwards compatible with older versions of Angular. This means for Ionic to add support for standalone components, Ionic would have to remove support for Angular 13 and lower.

If you are wanting to experiment with an Angular 14 project and Ionic using standalone components, the following dev-build is available:

6.1.7-dev.11654279011.1b971e3e

For an example Ionic application on Angular 14, you can clone: https://github.com/sean-perkins/angular-14-demo. Remember to install the available dev-build.

Screen Shot 2022-06-03 at 2 02 40 PM

Describe the Use Case

Ionic developers should be able to use the following code:

{
   path: 'standalone',
   loadComponent: () => import('./standalone.component').then(m => m.StandaloneComponent)
 }

To create a route of /standalone that renders the StandaloneComponent inside of the ion-router-outlet.

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions