Skip to content

Commit 90a3702

Browse files
docs(tabs): update angular to standalone (#3967)
1 parent 16947cc commit 90a3702

31 files changed

+156
-264
lines changed
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
```html
2-
<ion-router-outlet></ion-router-outlet>
2+
<ion-app>
3+
<ion-router-outlet></ion-router-outlet>
4+
</ion-app>
35
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonApp, IonRouterOutlet } from '@ionic/angular/standalone';
4+
5+
@Component({
6+
selector: 'app-root',
7+
templateUrl: 'app.component.html',
8+
styleUrls: ['app.component.css'],
9+
imports: [IonApp, IonRouterOutlet],
10+
})
11+
export class AppComponent {
12+
constructor() {}
13+
}
14+
```

static/usage/v7/tabs/router/angular/app_module_ts.md

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
```ts
2+
import { Routes } from '@angular/router';
3+
import { ExampleComponent } from './example.component';
4+
5+
export const routes: Routes = [
6+
{
7+
path: 'example',
8+
component: ExampleComponent,
9+
children: [
10+
{
11+
path: 'home',
12+
loadComponent: () => import('./home/home-page.component').then((m) => m.HomePageComponent),
13+
},
14+
{
15+
path: 'library',
16+
loadComponent: () => import('./library/library-page.component').then((m) => m.LibraryPageComponent),
17+
},
18+
{
19+
path: 'radio',
20+
loadComponent: () => import('./radio/radio-page.component').then((m) => m.RadioPageComponent),
21+
},
22+
{
23+
path: 'search',
24+
loadComponent: () => import('./search/search-page.component').then((m) => m.SearchPageComponent),
25+
},
26+
{
27+
path: '',
28+
redirectTo: '/example/home',
29+
pathMatch: 'full',
30+
},
31+
],
32+
},
33+
{
34+
path: '',
35+
redirectTo: '/example/home',
36+
pathMatch: 'full',
37+
},
38+
];
39+
```

static/usage/v7/tabs/router/angular/app_routing_module_ts.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

static/usage/v7/tabs/router/angular/example_component_ts.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonIcon, IonTabBar, IonTabButton, IonTabs } from '@ionic/angular/standalone';
34

45
import { addIcons } from 'ionicons';
56
import { library, playCircle, radio, search } from 'ionicons/icons';
@@ -8,6 +9,7 @@ import { library, playCircle, radio, search } from 'ionicons/icons';
89
selector: 'app-example',
910
templateUrl: 'example.component.html',
1011
styleUrls: ['example.component.css'],
12+
imports: [IonIcon, IonTabBar, IonTabButton, IonTabs],
1113
})
1214
export class ExampleComponent {
1315
constructor() {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';
34

45
@Component({
56
selector: 'app-home-page',
67
templateUrl: './home-page.component.html',
8+
imports: [IonContent, IonHeader, IonTitle, IonToolbar],
79
})
810
export class HomePageComponent {}
911
```

static/usage/v7/tabs/router/angular/home_page_module_ts.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/angular/standalone';
34

45
@Component({
56
selector: 'app-library-page',
67
templateUrl: './library-page.component.html',
8+
imports: [IonContent, IonHeader, IonTitle, IonToolbar],
79
})
810
export class LibraryPageComponent {}
911
```

static/usage/v7/tabs/router/angular/library_page_module_ts.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)