-
Notifications
You must be signed in to change notification settings - Fork 7
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
Atob is not defined #120
Comments
Hi Kirill, is it possible that you're using |
Yes, I do indeed use atob in one route, but it seems like my options here are limited to excluding a route, right? |
You could create a little helper which uses the API of the current platform. import { PLATFORM_ID } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';
export class Base64Service {
constructor(private @Inject(PLATFORM_ID) platformId: Object) { }
public atob(value: string): string {
return isPlatformBrowser(platformId)
? atob(value)
: Buffer.from(value).toString('base64');
}
} Or you replace the corresponding service, component, ... by using the DI of the AppServerModule. |
Thank you! |
When using angular-prerender with angular 9 application, it crashes on
The text was updated successfully, but these errors were encountered: