Skip to content
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

Closed
jamercee opened this issue Mar 17, 2018 · 6 comments
Closed

Bug in Lifecycle Hooks Tutorial #22847

jamercee opened this issue Mar 17, 2018 · 6 comments
Milestone

Comments

@jamercee
Copy link

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[X] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

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 the LoggerService through assigning the hookLog variable to logger.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>

@ngbot ngbot bot added this to the needsTriage milestone Mar 17, 2018
@trotyl
Copy link
Contributor

trotyl commented Mar 17, 2018

Can be confirmed, it was broken by #20395.

@jamercee
Copy link
Author

jamercee commented Mar 17, 2018

Interesting. Isn't the correct approach with peek-a-boo-parent the same taken with spy 29c7358

@trotyl
Copy link
Contributor

trotyl commented Apr 5, 2018

Looks duplicate of #22279

@trotyl
Copy link
Contributor

trotyl commented Apr 6, 2018

Closed by #23201

@jenniferfell
Copy link
Contributor

Thanks @jamercee for submitting and @trotyl for identifying the PR with the fix. Closing.

If the issue isn't resolved to your satisfaction, please confirm with v6 and open a new issue. Thank you!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants