You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
Im trying to use ngx-toastr basically in ngOnInıt like below code.If i use same code in button click event it works perfectly with no error.Is it related with isStable control i use it for using the setInterval otherwise cant use setInterval without stable angular.What causes this and how can i fix this ?
Error:RuntimeError: NG0205: Injector has already been destroyed.
at R3Injector.assertNotDestroyed (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:4393:13)
at R3Injector.get (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:4300:10)
at Object.definition.getStandaloneInjector (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:18887:27)
at ComponentFactory.create (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:12693:53)
at DomPortalHost.attachComponentPortal (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:487:37)
at DomPortalHost.attach (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:313:17)
at OverlayRef.attach (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:560:29)
at _ToastrService._buildNotification (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:804:31)
at _ToastrService._preBuildNotification (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:765:17)
at _ToastrService.success (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:669:17) {
code: 205
Thanks
The text was updated successfully, but these errors were encountered:
Hi ,
Im trying to use ngx-toastr basically in ngOnInıt like below code.If i use same code in button click event it works perfectly with no error.Is it related with isStable control i use it for using the setInterval otherwise cant use setInterval without stable angular.What causes this and how can i fix this ?
app.component.ts:
ngOnInit(): void {
this.applicationRef.isStable.pipe(first((isStable) => isStable)).subscribe(() => {
console.log("stable");
var timeoutObj=setInterval(() => {
this.progressValue+=1;
console.log(this.progressValue)
this.changeDetectorRef.detectChanges();
if(this.progressValue === 100){
this.toastr.success("Top right");
clearInterval(timeoutObj);
}
Error:RuntimeError: NG0205: Injector has already been destroyed.
at R3Injector.assertNotDestroyed (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:4393:13)
at R3Injector.get (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:4300:10)
at Object.definition.getStandaloneInjector (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:18887:27)
at ComponentFactory.create (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\chunk-VEVNQUEW.js:12693:53)
at DomPortalHost.attachComponentPortal (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:487:37)
at DomPortalHost.attach (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:313:17)
at OverlayRef.attach (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:560:29)
at _ToastrService._buildNotification (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:804:31)
at _ToastrService._preBuildNotification (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:765:17)
at _ToastrService.success (C:\Users...\OneDrive\Desktop\angular\progressSample.angular\cache\18.1.2\vite\deps_ssr\ngx-toastr.js:669:17) {
code: 205
Thanks
The text was updated successfully, but these errors were encountered: