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: README.md
+41-38Lines changed: 41 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,13 @@ import { Ng2AboutComponentClass } from "./about.ng2.component";
17
17
/// ...
18
18
19
19
$stateProvider.state({
20
-
name:'home',
20
+
name:'home',
21
21
url:'/home',
22
22
component:'ng1HomeComponent'// AngularJS component or directive name
23
23
})
24
24
25
25
.state({
26
-
name:'about',
26
+
name:'about',
27
27
url:'/about',
28
28
component: Ng2AboutComponentClass // Angular component class reference
29
29
});
@@ -43,17 +43,11 @@ When routing to an Angular component, that component uses the standard
43
43
When routing to an AngularJS component or template, that component uses the standard
44
44
[AngularJS directives (ui-view and ui-sref) from `@uirouter/angularjs`](https://ui-router.github.io/ng1/docs/latest/modules/directives.html).
45
45
46
-
See the [hybrid sample app](https://github.com/ui-router/sample-app-ng1-to-ng2) for a full example.
47
-
48
-
### UpgradeAdapter vs UpgradeModule
49
-
50
-
Version 2.0.0 of `@uirouter/angular-hybrid` only supports `UpgradeAdapter`, which works fine but is no longer in development.
51
-
Version 3.0.0 of `@uirouter/angular-hybrid` will support only `UpgradeModule` from `@angular/upgrade/static`, which is what the Angular team actively supports for hybrid mode.
52
-
Because we are dropping support for `UpgradeAdapter`, current users will have to switch to `UpgradeModule`.
46
+
See the [hybrid sample app](https://github.com/ui-router/sample-app-angular-hybrid) for a full example.
53
47
54
48
### Getting started
55
49
56
-
Remove `angular-ui-router` (or `@uirouter/angularjs`) from your package.json and replace it with `@uirouter/angular-hybrid`.
50
+
Remove `angular-ui-router` (or `@uirouter/angularjs`) from your AngularJS app's package.json and replace it with `@uirouter/angular-hybrid`.
57
51
Add the `@angular/*` dependencies.
58
52
59
53
```
@@ -86,26 +80,33 @@ let ng1module = angular.module("myApp", ['ui.router', 'ui.router.upgrade']);
86
80
87
81
#### Create a root Angular NgModule
88
82
89
-
- Import the `BrowserModule`, `UpgradeModule`, and the`UIRouterUpgradeModule`.
90
-
91
-
-Any AngularJS services you want to expose to Angular should have a `providers` entry.
83
+
- Import the `BrowserModule`, `UpgradeModule`, and a`UIRouterUpgradeModule.forChild()` module.
84
+
- Add `providers` entry for any AngularJS services you want to expose to Angular.
85
+
-The module should have a `ngDoBootstrap` method which calls the `UpgradeModule`'s `bootstrap` method.
92
86
93
-
- The module should have a no-op `ngDoBootstrap` method.
@@ -240,7 +235,8 @@ Because of this, apps should be migrated starting from leaf states/views and wor
240
235
241
236
---
242
237
243
-
When a state has an `onEnter`, `onExit`, or `onRetain`, they are always injected (AngularJS style), even if the state uses Angular 2+ components or is added to an `UIRouterModule.forChild``NgModule`.
238
+
When a state has an `onEnter`, `onExit`, or `onRetain`, they are always injected (AngularJS style),
239
+
even if the state uses Angular 2+ components or is added to an `UIRouterUpgradeModule.forChild``NgModule`.
The minimal example of `@uirouter/angular-hybrid` can be found here: https://github.com/ui-router/angular-hybrid/tree/master/example
259
255
260
256
A full fledged sample application example can be found here: https://github.com/ui-router/sample-app-angular-hybrid
257
+
258
+
# UpgradeAdapter vs UpgradeModule
259
+
260
+
Version 2.0.0 of `@uirouter/angular-hybrid` only supports `UpgradeAdapter`, which works fine but is no longer in development.
261
+
Version 3+0.0+ of `@uirouter/angular-hybrid` will support only `UpgradeModule` from `@angular/upgrade/static`, which is what the Angular team actively supports for hybrid mode.
262
+
Because we are dropping support for `UpgradeAdapter`, current users will have to switch to `UpgradeModule`.
0 commit comments