Skip to content

Commit 919f3fd

Browse files
author
vakrilov
committed
Minor improvements
1 parent d22a549 commit 919f3fd

File tree

4 files changed

+5395
-27
lines changed

4 files changed

+5395
-27
lines changed

app/animate-child.component.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,16 @@ import { Component } from "@angular/core";
1818
trigger("parent", [
1919
transition("* => *", [
2020
style({ transform: "translate(200px)" }),
21-
animate(1000,
22-
style({ transform: "translate(0px)" })),
23-
query("@child", animateChild())
21+
animate(1000, style({ transform: "translate(0px)" })),
22+
query("@child", animateChild())
2423
])
2524
]),
2625
trigger("child", [
2726
transition("* => *", [
28-
style({ opacity:0 }),
29-
animate(400, style({ opacity:1 }))
27+
style({ opacity: 0 }),
28+
animate(400, style({ opacity: 1 }))
3029
])
31-
])
30+
])
3231
],
3332
styles: [
3433
`.parent {

app/query-stagger.component.ts

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import {
2-
animate,
3-
query,
4-
stagger,
5-
style,
6-
transition,
7-
trigger,
8-
} from "@angular/animations";
2+
animate,
3+
query,
4+
stagger,
5+
style,
6+
transition,
7+
trigger,
8+
} from "@angular/animations";
99
import { Component } from "@angular/core";
10-
10+
1111
@Component({
1212
moduleId: module.id,
1313
animations: [
1414
trigger("listAnimation", [
1515
transition("* => *", [
1616
// this hides everything right away
1717
query(":enter", style({ opacity: 0 })),
18-
18+
1919
// starts to animate things with a stagger in between
20-
query(":enter", stagger("200ms", [
21-
animate("1s", style({ opacity: 1 }))
22-
]))
20+
query(":enter", stagger(200, [
21+
animate(1000, style({ opacity: 1 }))
22+
]), { delay: 200 })
2323
])
2424
])
2525
],
@@ -28,21 +28,18 @@ import { Component } from "@angular/core";
2828
<Button (tap)="add()" text="ADD" backgroundColor="hotpink"></Button>
2929
3030
<StackLayout [@listAnimation]="items.length">
31-
<ng-template ngFor let-item let-i="index" [ngForOf]="items">
32-
<Button
33-
[text]="item"
34-
class="ani-button"
35-
></Button>
36-
</ng-template>
37-
31+
<Button *ngFor="let item of items" [text]="item" class="ani-button"></Button>
3832
</StackLayout>
3933
</StackLayout>
4034
`
4135
})
4236
export class QueryStaggerComponent {
4337
public items = [
44-
"Enter",
38+
"Dramatic",
39+
"Entrance",
4540
"With",
41+
"Really",
42+
"Cool",
4643
"Stagger",
4744
];
4845

0 commit comments

Comments
 (0)