-
Notifications
You must be signed in to change notification settings - Fork 24.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in Lifecycle Hooks Tutorial #22847
Comments
Can be confirmed, it was broken by #20395. |
Interesting. Isn't the correct approach with |
Looks duplicate of #22279 |
Closed by #23201 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
There is a bug in the lifecycle-hooks demonstration code https://angular.io/guide/lifecycle-hooks#peek-a-boo-all-hooks. The
peek-a-boo-parent-component.ts
does not display log content.Minimal reproduction of the problem with instructions
If you visit the live site, you can see that all actions taken on the Peek-A-Boo component display no log entries https://angular.io/generated/live-examples/lifecycle-hooks/stackblitz.html.
I am new to Angular, but I believe the source of the problem is how the
app/peek-a-boo-parent-component.ts
attempts to pull the log entries from theLoggerService
through assigning thehookLog
variable tologger.logs
. It then attempts to display the log using the following code:<div *ngFor="let msg of hookLog">{{msg}}</div>
I was able to get the log output by changing the code to:
<div *ngFor="let msg of logger.logs">{{msg}}</div>
The text was updated successfully, but these errors were encountered: