4
src/app/views/beta/auth-form/auth-form.component.html
Normal file
4
src/app/views/beta/auth-form/auth-form.component.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<app-login>
|
||||
</app-login>
|
||||
<app-register *ngIf="!isLoggedIn">
|
||||
</app-register>
|
||||
23
src/app/views/beta/auth-form/auth-form.component.spec.ts
Normal file
23
src/app/views/beta/auth-form/auth-form.component.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
31
src/app/views/beta/auth-form/auth-form.component.ts
Normal file
31
src/app/views/beta/auth-form/auth-form.component.ts
Normal 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();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user