You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/updating/4-0.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ We suggest the following general process when migrating an existing application
30
30
31
31
In many cases, using the Ionic CLI to generate a new object and then copying the code also works very well. For example: `ionic g service weather` will create a shell `Weather` service and test. The code can then be copied from the older project with minor modifications as needed. This helps to ensure the proper structure is followed. This also generates shells for unit tests.
32
32
33
-
## Changes in Package Name
33
+
###Changes in Package Name
34
34
35
35
In Ionic 4, the package name is `@ionic/angular`. Uninstall Ionic 3 and install Ionic 4 using the new package name:
While migrating an app, update the imports from `ionic-angular` to `@ionic/angular`.
43
43
44
-
## Project structure
44
+
###Project structure
45
45
46
46
One of the major changes between an Ionic 3 app and an Ionic 4 app is the overall project layout and structure. In v3, Ionic apps had a custom convention for how an app should be set up and what that folder structure should look like. In v4, this has been changed to follow the recommended setup of each supported framework.
47
47
@@ -133,19 +133,19 @@ See the following `ionic.config.json` as an example:
133
133
}
134
134
```
135
135
136
-
## RxJS Changes
136
+
###RxJS Changes
137
137
138
138
Between V3 and V4, RxJS was updated to version 6. This changes many of the import paths of operators and core RxJS functions. Please see the <ahref="https://github.com/ReactiveX/rxjs/blob/6.x/docs_app/content/guide/v6/migration.md"target="_blank">RxJS Migration Guide</a> for details.
139
139
140
-
## Lifecycle Events
140
+
###Lifecycle Events
141
141
142
142
With V4, we're now able to utilize the typical events provided by [Angular](https://angular.io/guide/lifecycle-hooks). But for certain cases, you might want to have access to the events fired when a component has finished animating during its route change. In this case, the `ionViewWillEnter`, `ionViewDidEnter`, `ionViewWillLeave`, and `ionViewDidLeave` have been ported over from V3. Use these events to coordinate actions with Ionic's own animations system.
143
143
144
144
Older events like `ionViewDidLoad`, `ionViewCanLeave`, and `ionViewCanEnter` have been removed, and the proper Angular alternatives should be used.
145
145
146
146
For more details, check out the [router-outlet docs](../api/router-outlet.md)
147
147
148
-
## Overlay Components
148
+
###Overlay Components
149
149
150
150
In prior versions of Ionic, overlay components such as Loading, Toast, or Alert were created synchronously. In Ionic v4, these components are all created asynchronously. As a result of this, the API is now promise-based.
151
151
@@ -183,15 +183,15 @@ async showAlert() {
183
183
}
184
184
```
185
185
186
-
## Navigation
186
+
###Navigation
187
187
188
188
In V4, navigation received the most changes. Now, instead of using Ionic's own `NavController`, we integrate with the official Angular Router. This not only provides a consistent routing experience across apps, but is much more dependable. The Angular team has an <ahref="http://angular.io/guide/router"target="_blank">excellent guide</a> on their docs site that covers the Router in great detail.
189
189
190
190
To provide the platform-specific animations that users are used to, we have created `ion-router-outlet` for Angular Apps. This behaves in a similar manner to Angular's `router-outlet` but provides a stack-based navigation (tabs) and animations.
191
191
192
192
For a detailed explanation in navigation works in a V4 project, check out the [Angular navigation guide](../angular/navigation.md).
193
193
194
-
## Lazy Loading
194
+
###Lazy Loading
195
195
196
196
Since Navigation has changed, the mechanism for lazy loading has also changed in V4.
197
197
@@ -241,7 +241,7 @@ export class AppModule {}
241
241
242
242
For a detailed explanation of lazy loading in V4 project, check out the [Angular navigation guide](../angular/navigation.md#lazy-loading-routes).
243
243
244
-
## Markup Changes
244
+
###Markup Changes
245
245
246
246
Since v4 moved to Custom Elements, there's been a significant change to the markup for each component. These changes have all been made to follow the Custom Elements spec, and have been documented in a <ahref="https://github.com/ionic-team/ionic/blob/master/angular/BREAKING.md#breaking-changes"target="_blank">dedicated file on GitHub</a>.
0 commit comments