-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Plan for beeing supported by Server Side Rendering #5
Comments
Hello @M2Key, from my perspective it looks like a cool feature, I will have a look into it. |
I have the same question,But my project use [email protected], I can't update to [email protected] . are you able to provide any methods to resolve it? |
Please provide some sample-code for me on a plunkr or jsfiddle. |
@Cordobo use [email protected], my project use [email protected], when I run it with ssr, error "document is not defined" in [email protected] module . I have no idea to resolve it. |
These few changes makes SSR work for me: angularx-qrcode.component.ts:
The main point is to not init QRCode when running server side, so I changed the import 'qrcodejs2' to a require being applied in ngAfterViewInit. Since the code in ngOnInit now depends on ngAfterViewInit, I simply moved the code to that method, where we also know if QRCode is properly initialized. |
Maybe a pull request and a new release on NPM? |
Hi, I have installed two versions of this package (^1.2.4 and ^1.5.3) in differents proyects, but i´dont see if the code of @cbernth is all ready implemented, is that so in what version of the package can i see this code, please? |
Hi, @Cordobo thank you for your answer, currently I need this in my work so, do you have any plan to implement this anytime soon?... I really appreciate your effort in this project and I don´t wanna sound rude...thank you in advance. P.S: Or if you know how I can implement this would also be helpful, I tried to use the code of @cbernth but when I execute the universal angular the same error occurs. |
i need too for my work so, please could you help us to fix it for angular universal. |
@Dyabel03 @alchemistt99 PRs are more than welcome! |
/frontend/dist/server.js:226874 ReferenceError: document is not defined not working in 1.5.3 |
Thanks to code contributed by @cbernth and @ZhenhangTung, as of version 1.6.0, angularx-qrcode has fully implemented SSR support. Closing this (please open another issue, if you encounter any) |
I got
version 1.6.1 and version 1.6.0 |
Hi @naumov-dev, could you please provide a stripped down repo for me to reproduce? |
@Cordobo Same thing happened to me. Here is my PR, but I don't know why my changes don't exist anymore on the dev branch, which has cost me several hours to find out the true problem. If you look at my company's fork, you will see the:
On your master branch, my changes still don't exist. |
@ZhenhangTung Thanks for your investigation, I have a look into it |
@ZhenhangTung I have reapplied the PRs and released a fixed version 1.6.4. Thanks for your feedback! |
Is it possible to generate the QR code from a component? I want to display a smaller version on the page, but when the user clicks the image generated from qrdata (wrapped in an anchor), I'd like to let them download a larger version. Can that be done? |
@baywind2018 Could you show some pseudocode to us? From my understanding, the easiest way is to generate 2 QR code and make the larger one |
Is there any plan for make it compatible with SSR.
Once I actived SSR, I received :
NodeInvocationException: Prerendering failed because of error: ReferenceError: document is not defined
The text was updated successfully, but these errors were encountered: