Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 2a31357

Browse files
docs(router): Added transition aliases for route animations
1 parent 8b0d6fe commit 2a31357

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

public/docs/_examples/router/ts/app/crisis-center/crisis-detail.component.1.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ import { DialogService } from '../dialog.service';
3535
transform: 'translateX(0)'
3636
})
3737
),
38-
transition('void => *', [
38+
transition(':enter', [
3939
style({
4040
opacity: 0,
4141
transform: 'translateX(-100%)'
4242
}),
4343
animate('0.2s ease-in')
4444
]),
45-
transition('* => void', [
45+
transition(':leave', [
4646
animate('0.5s ease-out', style({
4747
opacity: 0,
4848
transform: 'translateY(100%)'

public/docs/_examples/router/ts/app/crisis-center/crisis-detail.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import { DialogService } from '../dialog.service';
3434
transform: 'translateX(0)'
3535
})
3636
),
37-
transition('void => *', [
37+
transition(':enter', [
3838
style({
3939
opacity: 0,
4040
transform: 'translateX(-100%)'
4141
}),
4242
animate('0.2s ease-in')
4343
]),
44-
transition('* => void', [
44+
transition(':leave', [
4545
animate('0.5s ease-out', style({
4646
opacity: 0,
4747
transform: 'translateY(100%)'

public/docs/_examples/router/ts/app/heroes/hero-detail.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ import { Hero, HeroService } from './hero.service';
3434
transform: 'translateX(0)'
3535
})
3636
),
37-
transition('void => *', [
37+
transition(':enter', [
3838
style({
3939
opacity: 0,
4040
transform: 'translateX(-100%)'
4141
}),
4242
animate('0.2s ease-in')
4343
]),
44-
transition('* => void', [
44+
transition(':leave', [
4545
animate('0.5s ease-out', style({
4646
opacity: 0,
4747
transform: 'translateY(100%)'

public/docs/ts/latest/guide/router.jade

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,8 +1142,8 @@ h3#route-animation Adding animations to the route component
11421142
:marked
11431143
Next, we'll use a **host binding** for route animations named *@routeAnimation*. There is nothing special
11441144
about the choice of the binding name, but since we are controlling route animation, we'll go with `routeAnimation`.
1145-
The binding value is set to `true` because we only care about the `*` and `void` states which are
1146-
[entering and leaving](../guide/animations.html#example-entering-and-leaving) animation states.
1145+
The binding value is set to `true` because we only care about the `:enter` and `:leave` states which are
1146+
[entering and leaving](../api/core/index/transition-function.html#transition-aliases-enter-and-leave-) transition aliases.
11471147

11481148
We'll also add some display and positioning bindings for styling.
11491149

@@ -1152,8 +1152,8 @@ h3#route-animation Adding animations to the route component
11521152
:marked
11531153
Now we can build our animation trigger, which we'll call *routeAnimation* to match the binding we previously
11541154
setup. We'll use the **wildcard state** that matches any animation state our route component is in, along with
1155-
two *transitions*. One transition animates the component as it enters the application view (`void => *`), while the other
1156-
animates the component as it leaves the application view (`* => void`).
1155+
two *transitions*. One transition animates the component as it enters the application view (`:enter`), while the other
1156+
animates the component as it leaves the application view (`:leave`).
11571157

11581158
We could add different transitions to different route components depending on our needs. We'll just animate our `HeroDetailComponent` for this milestone.
11591159

@@ -2199,7 +2199,7 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
21992199

22002200
<a id="custom-preloading"></a>
22012201
:marked
2202-
### Custom Pre-Loading
2202+
### Custom Pre-Loading Strategy
22032203

22042204
Pre-loading all modules works well in some situations, but in some cases we need more control over what gets loaded eagerly. This becomes more clear
22052205
as we load our application on a mobile device, or a low bandwidth connection. We may only want to preload certain feature modules based on user metrics
@@ -2236,9 +2236,8 @@ h3#preloading <i>Pre-Loading</i>: background loading of feature areas
22362236
+makeExcerpt('app/admin/admin-dashboard.component.ts (preloaded modules)', '')
22372237

22382238
:marked
2239-
Once our application is loaded to our inital route, the *CrisisCenterModule* is loaded eagerly. We can verify this by logging in to the `Admin` feature area and
2240-
noting that our `Crisis Center` is listed in the `Preloaded Modules.`
2241-
2239+
Once our application is loaded to our initial route, the *CrisisCenterModule* is loaded eagerly. We can verify this by logging in to the `Admin` feature area and
2240+
noting that our `Crisis Center` is listed in the `Preloaded Modules`. We can continue to add feature modules to be selectively loaded eagerly.
22422241

22432242

22442243
<a id="final-app"></a>

0 commit comments

Comments
 (0)