-
-
Basic State
-
Switch between active/inactive on click.
-
-
-
-
Styles inline in transitions
-
Animated effect on click, no persistend end styles.
-
-
-
-
Combined transition syntax
-
Switch between active/inactive on click. Define just one transition used in both directions.
-
-
-
-
Two-way transition syntax
-
Switch between active/inactive on click. Define just one transition used in both directions using the <=> syntax.
-
-
-
-
Enter & Leave
-
Enter and leave animations using the void state.
-
-
-
-
-
-
Enter & Leave & States
-
- Enter and leave animations combined with active/inactive state animations.
- Different enter and leave transitions depending on state.
-
-
-
-
-
Auto Style Calc
-
Leave animation from the current computed height using the auto-style value *.
-
-
-
-
Different Timings
-
Enter and leave animations with different easings, ease-in for enter, ease-out for leave.
-
-
-
-
Multiple Keyframes
-
Enter and leave animations with three keyframes in each, to give the transition some bounce.
-
-
-
-
Parallel Groups
-
Enter and leave animations with multiple properties animated in parallel with different timings.
-
-
-
- `,
- styles: [`
- .buttons {
- text-align: center;
- }
- button {
- padding: 1.5em 3em;
- }
- .columns {
- display: flex;
- flex-direction: row;
- }
- .column {
- flex: 1;
- padding: 10px;
- }
- .column p {
- min-height: 6em;
- }
- `],
- providers: [HeroService]
-})
-export class HeroTeamBuilderComponent {
- heroes: Hero[];
-
- constructor(private heroService: HeroService) {
- this.heroes = heroService.heroes;
- }
-}
diff --git a/aio/content/examples/animations/src/app/hero.service.ts b/aio/content/examples/animations/src/app/hero.service.ts
deleted file mode 100644
index c0053d0185..0000000000
--- a/aio/content/examples/animations/src/app/hero.service.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { Injectable } from '@angular/core';
-
-// #docregion hero
-export class Hero {
- constructor(public name: string, public state = 'inactive') { }
-
- toggleState() {
- this.state = this.state === 'active' ? 'inactive' : 'active';
- }
-}
-// #enddocregion hero
-
-const ALL_HEROES = [
- 'Windstorm',
- 'RubberMan',
- 'Bombasto',
- 'Magneta',
- 'Dynama',
- 'Narco',
- 'Celeritas',
- 'Dr IQ',
- 'Magma',
- 'Tornado',
- 'Mr. Nice'
-].map(name => new Hero(name));
-
-@Injectable()
-export class HeroService {
-
- heroes: Hero[] = [];
-
- canAdd() {
- return this.heroes.length < ALL_HEROES.length;
- }
-
- canRemove() {
- return this.heroes.length > 0;
- }
-
- addActive(active = true) {
- let hero = ALL_HEROES[this.heroes.length];
- hero.state = active ? 'active' : 'inactive';
- this.heroes.push(hero);
- }
-
- addInactive() {
- this.addActive(false);
- }
-
- remove() {
- this.heroes.length -= 1;
- }
-
-}
diff --git a/aio/content/examples/animations/src/app/hero.ts b/aio/content/examples/animations/src/app/hero.ts
new file mode 100644
index 0000000000..e3eac516da
--- /dev/null
+++ b/aio/content/examples/animations/src/app/hero.ts
@@ -0,0 +1,4 @@
+export class Hero {
+ id: number;
+ name: string;
+}
diff --git a/aio/content/examples/animations/src/app/home.component.css b/aio/content/examples/animations/src/app/home.component.css
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/aio/content/examples/animations/src/app/home.component.html b/aio/content/examples/animations/src/app/home.component.html
new file mode 100644
index 0000000000..0fb44758d8
--- /dev/null
+++ b/aio/content/examples/animations/src/app/home.component.html
@@ -0,0 +1,3 @@
+