Compatibility with Angular Universal
See original GitHub issueHello,
I’m trying to integrate the component into my app, using Universal server-side rendering.
My code works fine (thanks for this good component!) without the SSR.
When running with SSR, this error occurs :
ERROR TypeError: this.elemRef.nativeElement.getBoundingClientRect is not a function
at MinHDirective.JqLiteWrapper.getBoundingClientRect (path_to_project\node_modules\ng5-slider\bundles\ng5-slider.umd.js:201:43)
So it seems that the component doesn’t deal with SSR constraints (no access to browser window, etc…).
Should it be possible to make this component working with Universal ? In the meantime, did someone find a workaround ?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Server-side rendering (SSR) with Angular Universal
This guide describes Angular Universal, a technology that renders Angular applications on the server. A normal Angular application executes in the browser, ...
Read more >Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >Angular Universal: real app problems - InDepth.Dev
In fact, Angular Universal is the only supported and most widely used solution for rendering Angular applications on the server. The difficulty of...
Read more >Releases · angular/universal - GitHub
Angular universal no longer supports Node.js versions 14.[15-19].x and 16.[10-12].x . Current supported versions of Node.js are 14.20.x ...
Read more >Server Side rendering with Angular universal 14 - Ganatan
Angular -universal allows to manage the seo with the server side rendering technique.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

just put in the constructor like this:
and
in the element that wraps ng5-slider component
No, I’m afraid the slider component is currently very closely tied to the browser.
getBoundingClientRect()is necessary to calculate slider bounds and position the sub-elements accordingly.To support something like Angular Universal, the slider layout would need to be re-written to use pure CSS in some clever way. I would have to research this further to see if this is possible. It would be actually a good thing to do, because it would also solve current performance issues.