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

Add angular universal support #105

Open
BruneXX opened this issue Dec 18, 2019 · 3 comments
Open

Add angular universal support #105

BruneXX opened this issue Dec 18, 2019 · 3 comments

Comments

@BruneXX
Copy link

BruneXX commented Dec 18, 2019

Hi Guys, I'm facing this issue and I think is related to universal since cannot find the navigator because need to use isPlatformBrowser can you add these feature?

/ng-app/node_modules/@alyle/ui/bundles/alyle-ui.umd.js:169
 Platform.EDGE = Platform.isBrowser && /(edge)/i.test(navigator.userAgent);

ReferenceError: navigator is not defined
@BruneXX
Copy link
Author

BruneXX commented Dec 18, 2019

I've found the file where the modifications need to be placed: https://github.com/A-l-y-l-e/Alyle-UI/blob/master/src/lib/src/platform/platform.ts

@Enlcxx
Copy link
Member

Enlcxx commented Dec 18, 2019

Hi @BruneXX, this already has universal angular support.

This happens when in your file running on node js document is defined, you should remove that line that defines document.
It must be like: (global as any).document = ...

@Enlcxx
Copy link
Member

Enlcxx commented Dec 18, 2019

Although this could be resolved by improving the conditionals in Platform.isBrowser, I will add it for the next release. Thanks for reporting this.

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

2 participants