From: Kai Moritz Date: Sun, 7 Sep 2025 00:31:03 +0000 (+0200) Subject: WIP:selbst X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=8660b4126dd7cff7ec6b1efb43d28ef5c318eb15;p=demos%2Fangular%2Fstored-login WIP:selbst --- diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index e12313f..016e9ff 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -15,10 +15,10 @@ import { selectToken, selectError, selectIsLoading } from '../store/login.select styleUrl: './login.component.less' }) export class LoginComponent { - username : string|undefined = undefined; - password : string|undefined = undefined; - token : string|undefined = undefined; - error : string|undefined = undefined; + username : string|null = null; + password : string|null = null; + token : string|null = null; + error : string|null = null; isLoading : boolean = false; constructor(private store: Store) { diff --git a/src/app/store/login.actions.ts b/src/app/store/login.actions.ts index 1319408..ba6e195 100644 --- a/src/app/store/login.actions.ts +++ b/src/app/store/login.actions.ts @@ -2,7 +2,7 @@ import { createAction, props } from '@ngrx/store'; export const login = createAction( '[Login] User Login', - props<{ username: string|undefined, password: string|undefined }>() + props<{ username: string|null, password: string|null }>() ); export const loginSuccess = createAction( diff --git a/src/app/store/login.reducers.ts b/src/app/store/login.reducers.ts index 762ae8b..a6c146a 100644 --- a/src/app/store/login.reducers.ts +++ b/src/app/store/login.reducers.ts @@ -2,8 +2,8 @@ import { createReducer, on } from '@ngrx/store'; import { login, loginSuccess, loginFailure } from './login.actions'; export interface State { - token: string|undefined; - error: string|undefined; + token: string|null; + error: string|null; isLoading: boolean; }