From: Kai Moritz Date: Sun, 29 Jun 2025 11:51:54 +0000 (+0200) Subject: TODO:selbst X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=7e698ec1b069f529cc228a38b7c5bd6519cc6465;p=demos%2Fangular%2Fstored-login TODO:selbst --- diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index a19edad..2ab7a69 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -10,11 +10,11 @@ import { selectToken, selectError, selectIsLoading } from '../store/login.select styleUrl: './login.component.less' }) export class LoginComponent { - username = ''; - password = ''; - token = ''; - error = ''; - isLoading = false; + username : string|undefined = undefined; + password : string|undefined = undefined; + token : string|undefined = undefined; + error : string|undefined = undefined; + isLoading : boolean = false; constructor(private store: Store) { this.store.select(selectToken).subscribe(token => (this.token = token)); diff --git a/src/app/store/login.actions.ts b/src/app/store/login.actions.ts index 784df9c..1319408 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, password: string }>() + props<{ username: string|undefined, password: string|undefined }>() ); export const loginSuccess = createAction( diff --git a/src/app/store/login.reducers.ts b/src/app/store/login.reducers.ts index 903c45a..762ae8b 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; - error: string; + token: string|undefined; + error: string|undefined; isLoading: boolean; }