-
Notifications
You must be signed in to change notification settings - Fork 120
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private @Inject(PLATFORM_ID) platformId: Object, | |
@Inject(PLATFORM_ID) private platformId: Object |
ngOnChanges(changes: SimpleChanges): void { | ||
this.ssrCompatible(); |
There was a problem hiding this comment.
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;
}
...
import type * as Highcharts from 'highcharts'; | ||
import type HighchartsESM from 'highcharts/es-modules/masters/highcharts.src'; | ||
import { isplatFormServer } from '@angular/common'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { isplatFormServer } from '@angular/common'; | |
import { isPlatformServer } from '@angular/common'; |
#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.