Skip to content

Conversation

fahrigedik
Copy link
Member

@fahrigedik fahrigedik commented Jul 9, 2025

Description

⚠️ Will be on draft until we published this :: #23262

Resolves #23270 (write the related issue number if available)

TODO: This PR updates the Angular documentation to use the modern inject() function for dependency injection instead of constructor-based injection.

Changes include:

  • Replaced constructor injection examples with inject() usage.
  • Updated code snippets and explanations to align with Angular 14+ best practices.
  • Improved clarity and consistency in DI-related sections.

This ensures our docs stay up-to-date with the latest Angular DI patterns and help developers adopt the new API more easily.

@fahrigedik fahrigedik added this to the 10.0-preview milestone Jul 9, 2025
Refactored Angular documentation examples to use the inject() function for dependency injection instead of constructor injection. This aligns the docs with Angular's recommended DI approach and improves code clarity for service and component instantiation.
Copy link
Contributor

@sumeyyeKurtulus sumeyyeKurtulus left a comment

Choose a reason for hiding this comment

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

It looks pretty nice and neat apart from very small points. If we just resolve the comments and these notes, it is ready to be merged

  • We need to change this constructor injection either

    docs/en/framework/ui/angular/theming.md

    constructor(@Inject(INJECTOR_PIPE_DATA_TOKEN) public data: UserMenu) {}
  • That would be the best if we also update these. Even if they are not listed in the navigation bar, they are still reachable.

    • docs/en/framework/ui/angular/how-replaceable-components-work-with-extensions.md

    • docs/en/framework/ui/angular/http-error-reporter-service.md

    • docs/en/framework/ui/angular/permission-management-component-replacement.md

    • docs/en/modules/setting-management.md

    • docs/en/ui-themes/lepton-x/angular-customization.md

    • the same applies for the tutorials folder :: docs/en/tutorials

@sumeyyeKurtulus sumeyyeKurtulus self-requested a review July 24, 2025 12:13
@sumeyyeKurtulus sumeyyeKurtulus marked this pull request as draft July 25, 2025 10:10
@sumeyyeKurtulus sumeyyeKurtulus marked this pull request as ready for review September 19, 2025 12:39
@sumeyyeKurtulus sumeyyeKurtulus removed the request for review from yagmurcelk September 19, 2025 12:40
@sumeyyeKurtulus sumeyyeKurtulus merged commit c1175d2 into dev Sep 19, 2025
2 checks passed
@sumeyyeKurtulus sumeyyeKurtulus deleted the issue-23270 branch September 19, 2025 13:56
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.

Angular - Updating documentation for the inject function migration
2 participants