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

Cfweb 121 interoperate @defer and migrate control structures #25

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Kancso0
Copy link
Collaborator

@Kancso0 Kancso0 commented Aug 5, 2024

No description provided.

Copy link
Collaborator

@Azaraky Azaraky left a comment

Choose a reason for hiding this comment

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

Please check which comments are really necessary. I think some should be deleted.
If the build is green, then in my opinion it can be merged.

@@ -17,6 +24,8 @@ export class ProductComponent {
@Input() product: Product;
@Output() productImageClicked: EventEmitter<void> = new EventEmitter<void>();

constructor(public elementRef: ElementRef) {}
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need the elementRef here?

export class ViewportService {
public isInViewport(elementRef: ElementRef<any>): Observable<boolean> {
return new Observable((observer) => {
const element = elementRef?.nativeElement.getElementsByTagName('p')[0];
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest that this element is provided as an argument instead of doing here the query (:

return this.displayableContentSections[index / 3];
}

public ngAfterViewInit(): void {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why cant we use the on-viewport here? https://angular.dev/guide/defer#on-viewport

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.

4 participants