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

#393 - highcharts ssr compatibility angular #394

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kai1992cool
Copy link

#393 - highcharts ssr compatibility angular

The documentation should also be updated for the same. There is no if condition needed, it will simply work for SSR.

Copy link
Contributor

@karolkolodziej karolkolodziej 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 for the update!
Could you please change the documentation accordingly?

Keep in mind that we are going to release a new version of this integration and this might not end up in the production.

@@ -23,10 +24,18 @@ export class HighchartsChartComponent implements OnDestroy, OnChanges {

constructor(
private el: ElementRef,
private _zone: NgZone // #75
private _zone: NgZone, // #75
private @Inject(PLATFORM_ID) platformId: Object,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private @Inject(PLATFORM_ID) platformId: Object,
@Inject(PLATFORM_ID) private platformId: Object

ngOnChanges(changes: SimpleChanges): void {
this.ssrCompatible();
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work. You need to make it like this:

ngOnChanges(changes: SimpleChanges): void {
 if (this.ssrCompatible()) {
      return;
    }
...

See in the demo.

import type * as Highcharts from 'highcharts';
import type HighchartsESM from 'highcharts/es-modules/masters/highcharts.src';
import { isplatFormServer } from '@angular/common';

Choose a reason for hiding this comment

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

Suggested change
import { isplatFormServer } from '@angular/common';
import { isPlatformServer } from '@angular/common';

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.

3 participants