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

Commit ae35f0e

Browse files
authored
docs(lifecycle-hooks): SimpleChange -> SimpleChanges #2741 (#2742)
1 parent 35d8695 commit ae35f0e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

public/docs/_examples/lifecycle-hooks/ts/app/counter.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// #docregion
22
import {
33
Component, Input,
4-
OnChanges, SimpleChange,
4+
OnChanges, SimpleChanges,
55
} from '@angular/core';
66

77
import { LoggerService } from './logger.service';
@@ -22,7 +22,7 @@ export class MyCounterComponent implements OnChanges {
2222
@Input() counter: number;
2323
changeLog: string[] = [];
2424

25-
ngOnChanges(changes: {[propertyName: string]: SimpleChange}) {
25+
ngOnChanges(changes: SimpleChanges) {
2626

2727
// Empty the changeLog whenever counter goes to zero
2828
// hint: this is a way to respond programmatically to external value changes.
@@ -36,7 +36,6 @@ export class MyCounterComponent implements OnChanges {
3636
let prev = JSON.stringify(chng.previousValue); // first time is {}; after is integer
3737
this.changeLog.push(`counter: currentValue = ${cur}, previousValue = ${prev}`);
3838
}
39-
4039
}
4140

4241
/***************************************/

public/docs/_examples/lifecycle-hooks/ts/app/on-changes.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// #docregion
33
import {
44
Component, Input, OnChanges,
5-
SimpleChange, ViewChild
5+
SimpleChanges, ViewChild
66
} from '@angular/core';
77

88
class Hero {
@@ -33,7 +33,7 @@ export class OnChangesComponent implements OnChanges {
3333
changeLog: string[] = [];
3434

3535
// #docregion ng-on-changes
36-
ngOnChanges(changes: {[propertyName: string]: SimpleChange}) {
36+
ngOnChanges(changes: SimpleChanges) {
3737
for (let propName in changes) {
3838
let chng = changes[propName];
3939
let cur = JSON.stringify(chng.currentValue);

public/docs/_examples/lifecycle-hooks/ts/app/peek-a-boo.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
OnChanges,
88
OnDestroy,
99
OnInit,
10-
SimpleChange
10+
SimpleChanges
1111
} from '@angular/core';
1212
import { Component, Input } from '@angular/core';
1313
import { LoggerService } from './logger.service';
@@ -51,7 +51,7 @@ export class PeekABooComponent extends PeekABoo implements
5151
}
5252

5353
// only called for/if there is an @input variable set by parent.
54-
ngOnChanges(changes: {[propertyName: string]: SimpleChange}) {
54+
ngOnChanges(changes: SimpleChanges) {
5555
let changesMsgs: string[] = [];
5656
for (let propName in changes) {
5757
if (propName === 'name') {

0 commit comments

Comments
 (0)