diff --git a/aio/content/examples/lifecycle-hooks/src/app/after-content.component.ts b/aio/content/examples/lifecycle-hooks/src/app/after-content.component.ts index 5c9abd7a7d..36d2cff20f 100644 --- a/aio/content/examples/lifecycle-hooks/src/app/after-content.component.ts +++ b/aio/content/examples/lifecycle-hooks/src/app/after-content.component.ts @@ -93,22 +93,20 @@ export class AfterContentComponent implements AfterContentChecked, AfterContentI

-- AfterContent Logs --

-
{{msg}}
+
{{msg}}
`, styles: ['.parent {background: burlywood}'], providers: [LoggerService] }) export class AfterContentParentComponent { - logs: string[]; show = true; - constructor(private logger: LoggerService) { - this.logs = logger.logs; + constructor(public logger: LoggerService) { } reset() { - this.logs = []; + this.logger.clear(); // quickly remove and reload AfterContentComponent which recreates it this.show = false; this.logger.tick_then(() => this.show = true); diff --git a/aio/content/examples/lifecycle-hooks/src/app/after-view.component.ts b/aio/content/examples/lifecycle-hooks/src/app/after-view.component.ts index f376f8684e..fd09962406 100644 --- a/aio/content/examples/lifecycle-hooks/src/app/after-view.component.ts +++ b/aio/content/examples/lifecycle-hooks/src/app/after-view.component.ts @@ -95,22 +95,20 @@ export class AfterViewComponent implements AfterViewChecked, AfterViewInit {

-- AfterView Logs --

-
{{msg}}
+
{{msg}}
`, styles: ['.parent {background: burlywood}'], providers: [LoggerService] }) export class AfterViewParentComponent { - logs: string[]; show = true; - constructor(private logger: LoggerService) { - this.logs = logger.logs; + constructor(public logger: LoggerService) { } reset() { - this.logs = []; + this.logger.clear(); // quickly remove and reload AfterViewComponent which recreates it this.show = false; this.logger.tick_then(() => this.show = true);