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

docs: Updated inject example to show constructor usage #162

Merged
merged 1 commit into from
Jun 14, 2023
Merged

docs: Updated inject example to show constructor usage #162

merged 1 commit into from
Jun 14, 2023

Conversation

ajitzero
Copy link
Contributor

@ajitzero ajitzero commented Jun 14, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Duplicate example in https://ngworker.github.io/lumberjack/docs/usage#using-the-lumberjackservice where both show usage with inject().

Issue Number: N/A

What is the new behavior?

Updated the first example to use the constructor for injection.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

Fixes #163

@nx-cloud
Copy link

nx-cloud bot commented Jun 14, 2023

☁️ Nx Cloud Report

Attention: This version of the Nx Cloud GitHub bot will cease to function on July 1st, 2023. An organization admin can update your integration here.

CI is running/has finished running commands for commit 2077fa5. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

@@ -91,7 +91,7 @@ import { LumberjackService } from '@ngworker/lumberjack';
// (...)
})
export class MyComponent implements OnInit {
readonly #lumberjack = inject(LumberjackService);
constructor(private readonly lumberjack: LumberjackService) {}
Copy link
Contributor Author

@ajitzero ajitzero Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reviewers: Expand below and see Line 110 for comparison.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice catch!

@NachoVazquez
Copy link
Contributor

Thanks for the PR @ajitzero ! Very appreciated.

I'll take a look right now.

Copy link
Contributor

@NachoVazquez NachoVazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! ❤️

@@ -91,7 +91,7 @@ import { LumberjackService } from '@ngworker/lumberjack';
// (...)
})
export class MyComponent implements OnInit {
readonly #lumberjack = inject(LumberjackService);
constructor(private readonly lumberjack: LumberjackService) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: nice catch!

@NachoVazquez
Copy link
Contributor

@all-contributors please add @ajitzero for docs

@allcontributors
Copy link
Contributor

@NachoVazquez

I've put up a pull request to add @ajitzero! 🎉

@NachoVazquez NachoVazquez merged commit 7e5da96 into ngworker:main Jun 14, 2023
8 of 9 checks passed
NachoVazquez added a commit that referenced this pull request Jun 14, 2023
Adds @ajitzero as a contributor for doc.

This was requested by NachoVazquez [in this
comment](#162 (comment))

[skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Co-authored-by: Nacho Vazquez <[email protected]>
@ajitzero ajitzero deleted the patch-1 branch June 14, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: Duplicate example for injecting service
2 participants