From cf60e0e8891d840d7c746a51200b6ab7063ecae5 Mon Sep 17 00:00:00 2001 From: Aristeidis Bampakos Date: Tue, 20 Oct 2020 19:52:01 +0300 Subject: [PATCH] docs: use SimpleChanges in component interaction guide (#39342) Use the SimpleChanges interface in the example of component interaction guide PR Close #39342 --- .../component-interaction/src/app/version-child.component.ts | 4 ++-- aio/content/examples/testing/src/app/demo/demo.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aio/content/examples/component-interaction/src/app/version-child.component.ts b/aio/content/examples/component-interaction/src/app/version-child.component.ts index b3cecd6872..93ef079d5d 100644 --- a/aio/content/examples/component-interaction/src/app/version-child.component.ts +++ b/aio/content/examples/component-interaction/src/app/version-child.component.ts @@ -1,6 +1,6 @@ /* tslint:disable:forin */ // #docregion -import { Component, Input, OnChanges, SimpleChange } from '@angular/core'; +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; @Component({ selector: 'app-version-child', @@ -17,7 +17,7 @@ export class VersionChildComponent implements OnChanges { @Input() minor: number; changeLog: string[] = []; - ngOnChanges(changes: {[propKey: string]: SimpleChange}) { + ngOnChanges(changes: SimpleChanges) { const log: string[] = []; for (const propName in changes) { const changedProp = changes[propName]; diff --git a/aio/content/examples/testing/src/app/demo/demo.ts b/aio/content/examples/testing/src/app/demo/demo.ts index 5c02167ea3..94e936cb87 100644 --- a/aio/content/examples/testing/src/app/demo/demo.ts +++ b/aio/content/examples/testing/src/app/demo/demo.ts @@ -4,7 +4,7 @@ import { Component, ContentChildren, Directive, EventEmitter, HostBinding, HostListener, OnInit, OnChanges, OnDestroy, Pipe, PipeTransform, - SimpleChange } from '@angular/core'; + SimpleChanges } from '@angular/core'; import { of } from 'rxjs'; import { delay } from 'rxjs/operators'; @@ -309,7 +309,7 @@ export class MyIfChildComponent implements OnInit, OnChanges, OnDestroy { this.changeLog.push('ngOnDestroy called'); } - ngOnChanges(changes: {[propertyName: string]: SimpleChange}) { + ngOnChanges(changes: SimpleChanges) { for (const propName in changes) { this.ngOnChangesCounter += 1; const prop = changes[propName];