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

Fixes primefaces/primeng#12734 - Add Document Injection #12735

Merged
merged 12 commits into from
Mar 25, 2023

Conversation

EnricoMessall
Copy link
Contributor

Fixed #12734

@vercel
Copy link

vercel bot commented Mar 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
primeng ⬜️ Ignored (Inspect) Mar 25, 2023 at 11:02AM (UTC)

 + Runned prettier
@@ -81,7 +81,7 @@ export class ButtonDirective implements AfterViewInit, OnDestroy {

private _internalClasses: string[] = Object.values(INTERNAL_BUTTON_CLASSES);

constructor(public el: ElementRef) {}
constructor(public el: ElementRef, @Inject(DOCUMENT) private document: Document) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I don't understand how importing helps?
You must use a variable from the token, this.document instead of document(Inside the component and helpers instead of the global variable document)

Copy link
Contributor Author

@EnricoMessall EnricoMessall Mar 11, 2023

Choose a reason for hiding this comment

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

Hey actually it should work because then Angular SSR knows a variable named document from the constructor if no one is present with just using document. But your absolute right that using this.document is the more correct way. Updated it :)

 + Use of this.document instead direct document
@cetincakiroglu cetincakiroglu self-assigned this Mar 24, 2023
@cetincakiroglu cetincakiroglu added Status: Pending Review Issue or pull request is being reviewed by Core Team Angular Universal Issue or pull request is related to Angular Universal Server Side Rendering and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 24, 2023
@cetincakiroglu
Copy link
Contributor

cetincakiroglu commented Mar 25, 2023

Hi @EnricoMessall

I've reviewed your pr, but can't merge due to conflicts, could you please resolve them and update the pr so we can merge safely?

And don't forget to mention me afterward.

Thanks for the effort and support to make PrimeNG better!

# Conflicts:
#	src/app/showcase/pages/landing/landing.component.ts
 + Fixed Prettier for Landing Page
@EnricoMessall
Copy link
Contributor Author

Hey @cetincakiroglu

i've merged the master branch into this ticket and also fixed a prettier warning on the landing page also. But there is one error in the Headless Test that shouldn't be from this ticket ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Angular Universal Issue or pull request is related to Angular Universal Server Side Rendering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular SSR Support - Multiple Components
3 participants