Skip to content

Commit 47be72e

Browse files
committed
added comments
1 parent e5ece06 commit 47be72e

File tree

5 files changed

+28
-6
lines changed

5 files changed

+28
-6
lines changed

app/_animations/fade-in.animation.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { trigger, state, animate, transition, style } from '@angular/animations';
1+
// import the required animation functions from the angular animations module
2+
import { trigger, state, animate, transition, style } from '@angular/animations';
23

34
export const fadeInAnimation =
5+
// trigger name for attaching this animation to an element using the [@triggerName] syntax
46
trigger('fadeInAnimation', [
7+
58
// route 'enter' transition
69
transition(':enter', [
710

8-
// styles at start of transition
11+
// css styles at start of transition
912
style({ opacity: 0 }),
1013

1114
// animation and styles at end of transition

app/_animations/slide-in-out.animation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { trigger, state, animate, transition, style } from '@angular/animations';
1+
// import the required animation functions from the angular animations module
2+
import { trigger, state, animate, transition, style } from '@angular/animations';
23

34
export const slideInOutAnimation =
5+
// trigger name for attaching this animation to an element using the [@triggerName] syntax
46
trigger('slideInOutAnimation', [
57

68
// end state styles for route container (host)

app/home/home.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { Component } from '@angular/core';
22

3+
// import fade in animation
34
import { fadeInAnimation } from '../_animations/index';
45

56
@Component({
67
moduleId: module.id.toString(),
78
templateUrl: 'home.component.html',
9+
10+
// make fade in animation available to this component
811
animations: [fadeInAnimation],
12+
13+
// attach the fade in animation to the host (root) element of this component
914
host: { '[@fadeInAnimation]': '' }
1015
})
1116

app/products/product-add-edit.component.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
import { Component, OnInit } from '@angular/core';
22
import { Router, ActivatedRoute } from '@angular/router';
33

4-
import { slideInOutAnimation } from '../_animations/index';
54
import { ProductService, PubSubService } from '../_services/index';
65

6+
// import slide in/out animation
7+
import { slideInOutAnimation } from '../_animations/index';
8+
79
@Component({
810
moduleId: module.id.toString(),
911
templateUrl: 'product-add-edit.component.html',
12+
13+
// make slide in/out animation available to this component
1014
animations: [slideInOutAnimation],
15+
16+
// attach the slide in/out animation to the host (root) element of this component
1117
host: { '[@slideInOutAnimation]': '' }
1218
})
1319

1420
export class ProductAddEditComponent implements OnInit {
15-
title = "Add Product";
21+
title = 'Add Product';
1622
product: any = {};
1723

1824
constructor(

app/products/product-list.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import { Component, OnInit, OnDestroy } from '@angular/core';
22
import { Subscription } from 'rxjs/Subscription';
33

4-
import { fadeInAnimation } from '../_animations/index';
54
import { ProductService, PubSubService } from '../_services/index';
65

6+
// import fade in animation
7+
import { fadeInAnimation } from '../_animations/index';
8+
79
@Component({
810
moduleId: module.id.toString(),
911
templateUrl: 'product-list.component.html',
12+
13+
// make fade in animation available to this component
1014
animations: [fadeInAnimation],
15+
16+
// attach the fade in animation to the host (root) element of this component
1117
host: { '[@fadeInAnimation]': '' }
1218
})
1319

0 commit comments

Comments
 (0)