WIP: Injection funktioniert auch so -- actions weiter undefined!
authorKai Moritz <kai@juplo.de>
Sun, 7 Sep 2025 11:28:34 +0000 (13:28 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 7 Sep 2025 11:28:34 +0000 (13:28 +0200)
src/app/store/login.effects.ts

index 7ceb864..bf29516 100644 (file)
@@ -1,4 +1,4 @@
-import { Injectable } from '@angular/core';
+import { Injectable, inject } from '@angular/core';
 import { Actions, createEffect, ofType } from '@ngrx/effects';
 import { map, catchError, switchMap } from 'rxjs/operators';
 import { of } from 'rxjs';
@@ -7,6 +7,8 @@ import { AuthService } from '../services/auth.service';
 
 @Injectable()
 export class LoginEffects {
+  private authService = inject(AuthService);
+
   login$ = createEffect(() =>
     this.actions$.pipe(
       ofType('[Login] User Login'),
@@ -19,5 +21,5 @@ export class LoginEffects {
     )
   );
 
-  constructor(private actions$: Actions, private authService: AuthService) {}
+  constructor(private actions$: Actions) {}
 }