aspnetcore-angular-universal
aspnetcore-angular-universal copied to clipboard
SSR: How to get periodic updates from server?
angular 6, asp.net core 2.1, serverside rendering
my app needs to call my api periodically to get user notification updates.
i tried wrapping my rxjs interval call inside my AppComponent
ngOnInit() { if (isPlatformBrowser(this.platformId)) { const subscribe = interval(5000).pipe( takeUntil(this.destroy$) ).subscribe(val => // do stuff ); } }
but the result of this are all my href links do a full browser reload. what's the best practice for doing this?
Not sure why this is needed but since SignalR is fully supported in Dotnet Core 2.1 a cleaner approach would probably be using SignalR. Otherwise, without knowing more it would be hard to describe how to fix your issue. If you can put an example on https://stackblitz.com/ .