Skip to content

Commit 194ba23

Browse files
committed
docs(angular): update tabs router example to use tab props
1 parent 57622f4 commit 194ba23

File tree

5 files changed

+34
-10
lines changed

5 files changed

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

static/usage/v6/tabs/router/angular/example_component_html.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
```html
2-
<router-outlet></router-outlet>
3-
<ion-tabs>
2+
<ion-tabs [environmentInjector]="environmentInjector">
43
<ion-tab-bar slot="bottom">
5-
<ion-tab-button routerLink="home" routerLinkActive="tab-selected">
4+
<ion-tab-button tab="home">
65
<ion-icon name="play-circle"></ion-icon>
76
Listen Now
87
</ion-tab-button>
9-
<ion-tab-button routerLink="radio" routerLinkActive="tab-selected">
8+
<ion-tab-button tab="radio">
109
<ion-icon name="radio"></ion-icon>
1110
Radio
1211
</ion-tab-button>
13-
<ion-tab-button routerLink="library" routerLinkActive="tab-selected">
12+
<ion-tab-button tab="library">
1413
<ion-icon name="library"></ion-icon>
1514
Library
1615
</ion-tab-button>
17-
<ion-tab-button routerLink="search" routerLinkActive="tab-selected">
16+
<ion-tab-button tab="search">
1817
<ion-icon name="search"></ion-icon>
1918
Search
2019
</ion-tab-button>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
```ts
2-
import { Component } from '@angular/core';
2+
import { Component, EnvironmentInjector } from '@angular/core';
33
import { CommonModule } from '@angular/common';
44
import { RouterModule } from '@angular/router';
55
import { IonicModule } from '@ionic/angular';
@@ -13,7 +13,7 @@ import { playCircle, library, radio, search } from 'ionicons/icons';
1313
standalone: true,
1414
})
1515
export class ExampleComponent {
16-
constructor() {
16+
constructor(public environmentInjector: EnvironmentInjector) {
1717
/**
1818
* Any icons you want to use in your application
1919
* can be registered in app.component.ts and then

static/usage/v6/tabs/router/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import Playground from '@site/src/components/global/Playground';
33
import javascript_index_html from './javascript/index_html.md';
44
import javascript_index_ts from './javascript/index_ts.md';
55

6+
import angular_app_component_html from './angular/app_component_html.md';
7+
import angular_app_component_ts from './angular/app_component_ts.md';
8+
69
import angular_example_component_html from './angular/example_component_html.md';
710
import angular_example_component_ts from './angular/example_component_ts.md';
811

@@ -18,7 +21,7 @@ import angular_radio_page_component_html from './angular/radio_page_component_ht
1821
import angular_search_page_component_ts from './angular/search_page_component_ts.md';
1922
import angular_search_page_component_html from './angular/search_page_component_html.md';
2023

21-
import app_routes_ts from './angular/app_routes_ts.md';
24+
import angular_app_routes_ts from './angular/app_routes_ts.md';
2225
import angular_global_css from './angular/global_css.md';
2326

2427
import vue_app_vue from './vue/app_vue.md';
@@ -49,7 +52,6 @@ import react_search_page_tsx from './react/search_page_tsx.md';
4952
files: {
5053
'src/app/example.component.html': angular_example_component_html,
5154
'src/app/example.component.ts': angular_example_component_ts,
52-
'src/app/app.routes.ts': app_routes_ts,
5355
'src/app/home/home-page.component.ts': angular_home_page_component_ts,
5456
'src/app/home/home-page.component.html': angular_home_page_component_html,
5557
'src/global.css': angular_global_css,
@@ -59,6 +61,9 @@ import react_search_page_tsx from './react/search_page_tsx.md';
5961
'src/app/radio/radio-page.component.html': angular_radio_page_component_html,
6062
'src/app/search/search-page.component.ts': angular_search_page_component_ts,
6163
'src/app/search/search-page.component.html': angular_search_page_component_html,
64+
'src/app/app.routes.ts': angular_app_routes_ts,
65+
'src/app/app.component.html': angular_app_component_html,
66+
'src/app/app.component.ts': angular_app_component_ts,
6267
},
6368
},
6469
vue: {

0 commit comments

Comments
 (0)