Skip to content

Conversation

@Maaz0313-png
Copy link

This pull request introduces improvements to the Angular Inertia integration, focusing on enhancing the InertiaLinkDirective for better usability and standards compliance, and making minor adjustments to dependency injection and application bootstrapping.

Enhancements to Inertia Link Handling:

  • Improved the InertiaLinkDirective to handle click events more robustly:

    • Now only triggers navigation for primary (left) mouse button clicks.
    • Respects modifier keys (Ctrl, Shift, Alt, Meta) to allow users to open links in new tabs or windows.
    • Falls back to the host element's href attribute if the directive input is not provided.
    • Prevents native navigation and uses the Inertia router for SPA navigation.
  • Added ElementRef injection to InertiaLinkDirective to support reading attributes from the host element.

Dependency Injection Update:

  • Changed the INERTIA_PAGES injection token to provide an array of InertiaPage instead of a single page, improving scalability for multi-page setups.

Application Bootstrapping:

  • Ensured that reflect-metadata is loaded before Angular decorators are evaluated, which is required for proper decorator behavior.

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.

1 participant