Skip to content

Commit 4e765f4

Browse files
authored
Merge pull request #60 from ionic-jp/feat/v7
feat(v7): v7へのプルリクエスト
2 parents 4f1de32 + bcee83a commit 4e765f4

File tree

6,326 files changed

+216159
-62459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

6,326 files changed

+216159
-62459
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check
2323
In order to run the documentation locally, install the dependencies and run the development server:
2424

2525
```sh
26-
$ npm install
26+
$ npm install --legacy-peer-deps
2727
$ npm start
2828
```
2929

30-
> **Note**: recent versions of npm (5+) and Node.js (10+) are required to run certain scripts.
30+
> **Note**: certain versions of npm (5-8) and Node.js (10-16) are required to run certain scripts.
3131
3232
---
3333

docs/angular/config.md

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

docs/angular/lifecycle.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ AngularのLife Cycle Eventsに加えて、Ionic Angularには、使用可能な
4141
| `ionViewWillLeave` | コンポーネントを離脱するアニメーションがはじまる時に発火します。 |
4242
| `ionViewDidLeave` | コンポーネントを離脱するアニメーションが終了した時に発火します。 |
4343

44-
`ionViewWillEnter``ionViewDidEnter` の違いは発火するタイミングです。前者は、 `ngOnInit` の直後であり、ページの処理がはじまる前に発火しますが、後者は処理が終了してから発火します。
44+
これらのライフサイクルは、ルーターによって直接マッピングされたコンポーネントに対してのみ呼び出されます。つまり、`/pageOne``PageOneComponent`にマッピングされた場合、Ionicライフサイクルは`PageOneComponent`で呼び出されますが、`PageOneComponent`がレンダリングする子コンポーネントでは呼び出されません。
45+
46+
`ionViewWillEnter``ionViewDidEnter`の違いは、いつ発火するかです。前者は `ngOnInit` の直後でページ遷移が始まる前に、後者は遷移が終わった後に直接呼び出されます。
4547

4648
`ionViewWillLeave``ionViewDidLeave` についてですが、 `ionViewWillLeave` は現在のページから離脱する処理がはじまる前に呼び出されますが、 `ionViewDidLeave` は新しいページに遷移する処理が成功してから呼び出されます (新しいページの `ionViewDidEnter` が発火した後になります)。
4749

docs/angular/navigation.md

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,54 @@ import { LoginComponent } from './login.component';
178178

179179
ここでは、`RouterModule` のインポートとともに、典型的な `Angular Module` の設定がありますが、`RouterModule` では `forChild` によってコンポーネントを使用することを宣言しています。この設定では、ビルドを実行するときに、`App Component`(Root)、 `login Component` 、および `detail Component` において別々のチャンクを作成します。
180180

181+
## Standalone Components
182+
183+
:::caution Experimental API
184+
185+
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.
186+
187+
:::
188+
189+
Standalone components allow developers to lazy load a component on a route without having to declare the component to an Angular module.
190+
191+
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.
192+
193+
```ts title="app.component.ts"
194+
import { Component, EnvironmentInjector } from '@angular/core';
195+
196+
@Component({
197+
selector: 'app-root',
198+
template: 'app.component.html',
199+
})
200+
export class AppComponent {
201+
constructor(public environmentInjector: EnvironmentInjector) {}
202+
}
203+
```
204+
205+
```html title="app.component.html"
206+
<ion-router-outlet [environmentInjector]="environmentInjector"></ion-router-outlet>
207+
<!-- or if you are using ion-tabs -->
208+
<ion-tabs [environmentInjector]="environmentInjector"> ... </ion-tabs>
209+
```
210+
211+
Developers can use the existing syntax for standalone component routing from Angular:
212+
213+
```ts
214+
@NgModule({
215+
imports: [
216+
RouterModule.forRoot([
217+
{
218+
path: 'standalone-route',
219+
loadComponent: () => import('./path/to/my-component.component').then((c) => c.MyComponent),
220+
},
221+
]),
222+
],
223+
})
224+
export class AppRoutingModule {}
225+
```
226+
227+
To get started with standalone components [visit Angular's official docs](https://angular.io/guide/standalone-components).
228+
181229
## Live Example
182230

183231
If you would prefer to get hands on with the concepts and code described above, please checkout our [live example](https://stackblitz.com/edit/ionic-angular-routing?file=src/app/app-routing.module.ts) of the topics above on StackBlitz.
@@ -192,8 +240,8 @@ The following is an example of linear routing in a mobile app:
192240

193241
<video
194242
style={{
195-
'margin': '40px auto',
196-
'display': 'flex'
243+
margin: '40px auto',
244+
display: 'flex',
197245
}}
198246
width="400"
199247
src={useBaseUrl('video/linear-routing-demo.mp4')}
@@ -218,8 +266,8 @@ The following is an example of non-linear routing:
218266

219267
<video
220268
style={{
221-
'margin': '40px auto',
222-
'display': 'flex'
269+
margin: '40px auto',
270+
display: 'flex',
223271
}}
224272
width="400"
225273
src={useBaseUrl('video/non-linear-routing-demo.mp4')}
@@ -433,8 +481,8 @@ The example below shows how the iOS App Store app handles presenting an "Account
433481

434482
<video
435483
style={{
436-
'margin': '40px auto',
437-
'display': 'flex'
484+
margin: '40px auto',
485+
display: 'flex',
438486
}}
439487
width="400"
440488
src={useBaseUrl('video/tabs-account-demo.mp4')}
@@ -449,6 +497,6 @@ Instead, we recommend having routes in each tab that reference the same componen
449497

450498
The example below shows how the Spotify app reuses the same album component to show content in multiple tabs. Notice that each screenshot shows the same album but from a different tab.
451499

452-
| Home Tab | Search Tab |
453-
| :------: | :--------: |
500+
| Home Tab | Search Tab |
501+
| :-------------------------------------------------: | :---------------------------------------------------: |
454502
| <img src={useBaseUrl('img/usage/tabs-home.jpg')} /> | <img src={useBaseUrl('img/usage/tabs-search.jpg')} /> |

0 commit comments

Comments
 (0)