The reference removed so that calling LoggerService clear() method behaves as intended in SpyComponent. PR Close #20395
This commit is contained in:
parent
0fedb57cb0
commit
697fb76960
|
@ -12,5 +12,5 @@
|
|||
</div>
|
||||
<!-- #enddocregion template -->
|
||||
<h4>-- Spy Lifecycle Hook Log --</h4>
|
||||
<div *ngFor="let msg of spyLog">{{msg}}</div>
|
||||
<div *ngFor="let msg of logger.logs">{{msg}}</div>
|
||||
</div>
|
||||
|
|
|
@ -15,10 +15,8 @@ import { LoggerService } from './logger.service';
|
|||
export class SpyParentComponent {
|
||||
newName = 'Herbie';
|
||||
heroes: string[] = ['Windstorm', 'Magneta'];
|
||||
spyLog: string[];
|
||||
|
||||
constructor(private logger: LoggerService) {
|
||||
this.spyLog = logger.logs;
|
||||
constructor(public logger: LoggerService) {
|
||||
}
|
||||
|
||||
addHero() {
|
||||
|
|
Loading…
Reference in New Issue