We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Probably due to resolving an observable, but TimeAgo only works on the browser. If implemented with SSR, SSR hangs and the page never loads.
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
I've prepared PR for this issue. As a workaround you can create following service:
import { isPlatformBrowser } from '@angular/common'; import { Inject, Injectable, PLATFORM_ID } from '@angular/core'; import { TimeagoDefaultClock } from 'ngx-timeago'; import { EMPTY, Observable } from 'rxjs'; @Injectable({ providedIn: 'root', }) export class TimeagoAppClock extends TimeagoDefaultClock { constructor( @Inject(PLATFORM_ID) private readonly platformId: Record<string, unknown> ) { super(); } tick(then: number): Observable<unknown> { return isPlatformBrowser(this.platformId) ? super.tick(then) : EMPTY; } }
and use it instead of default clock:
TimeagoModule.forRoot({ clock: { provide: TimeagoClock, useClass: TimeagoAppClock, }, }),
No branches or pull requests
Probably due to resolving an observable, but TimeAgo only works on the browser. If implemented with SSR, SSR hangs and the page never loads.
The text was updated successfully, but these errors were encountered: