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

document is not defined when using Angular Universal #11

Closed
MostafaYehia opened this issue Nov 21, 2020 · 0 comments
Closed

document is not defined when using Angular Universal #11

MostafaYehia opened this issue Nov 21, 2020 · 0 comments

Comments

@MostafaYehia
Copy link

MostafaYehia commented Nov 21, 2020

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

ERROR ReferenceError: document is not defined

 
    toElement(content) {
        const div = document.createElement('DIV');
        div.innerHTML = content;
        const svgElement = div.querySelector('svg');
        if (!svgElement) {
            throw Error(' tag not found');
        }
        return svgElement;
    }

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Support Angular Universal

Environment


Angular version: 10.1.6


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

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

No branches or pull requests

1 participant