TG-2 TG-9 - Push base Angular app

This commit is contained in:
2024-11-03 11:16:14 +01:00
parent cd590d21d9
commit 68d4b82756
36 changed files with 879 additions and 441 deletions

View File

@@ -0,0 +1,4 @@
<app-login>
</app-login>
<app-register *ngIf="!isLoggedIn">
</app-register>

View File

@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AuthFormComponent } from './auth-form.component';
describe('AuthFormComponent', () => {
let component: AuthFormComponent;
let fixture: ComponentFixture<AuthFormComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AuthFormComponent]
})
.compileComponents();
fixture = TestBed.createComponent(AuthFormComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,31 @@
import { Component } from '@angular/core';
import {LoginComponent} from "../../login/login.component";
import {NgIf} from "@angular/common";
import {RegisterComponent} from "../../register/register.component";
import {AuthService} from "../../../services/auth.service";
@Component({
selector: 'app-auth-form',
standalone: true,
imports: [
LoginComponent,
NgIf,
RegisterComponent
],
templateUrl: './auth-form.component.html',
styleUrl: './auth-form.component.scss'
})
export class AuthFormComponent {
constructor(private authService: AuthService) {
}
isLoggedIn = false;
ngOnInit() {
setTimeout(() => {
this.isLoggedIn = this.authService.isLoggedIn();
});
}
}