Skip to content

docs(angular): standalone components are not experimental #3665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions docs/angular/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,34 +175,8 @@ Here, we have a typical Angular Module setup, along with a RouterModule import,

## Standalone Components

:::warning Experimental API

Standalone components is an experimental API introduced in Angular 14.x and available in Ionic 6.3 and later. This feature may change before it is stable.

:::

Standalone components allow developers to lazy load a component on a route without having to declare the component to an Angular module.

To use standalone components with routing and Ionic Framework, you must first be on Ionic ^6.3.0. The experimental API requires developers to assign the `EnvironmentInjector` instance for each router outlet (`ion-router-outlet` and `ion-tabs`) that uses standalone component routing.

```ts title="app.component.ts"
import { Component, EnvironmentInjector } from '@angular/core';

@Component({
selector: 'app-root',
template: 'app.component.html',
})
export class AppComponent {
constructor(public environmentInjector: EnvironmentInjector) {}
}
```

```html title="app.component.html"
<ion-router-outlet [environmentInjector]="environmentInjector"></ion-router-outlet>
<!-- or if you are using ion-tabs -->
<ion-tabs [environmentInjector]="environmentInjector"> ... </ion-tabs>
```

Developers can use the existing syntax for standalone component routing from Angular:

```ts
Expand Down