Skip to content
Snippets Groups Projects
Commit 9424f78c authored by vincent.steinman's avatar vincent.steinman
Browse files

Merge branch 'main' into documentation

parents 2d28de55 c9e4da9c
Branches
No related tags found
1 merge request!1Documentation
Showing
with 18 additions and 22 deletions
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Answer, QandA, Question, User } from '../Types/types';
import { UsersService } from '../services/users.service';
import { QuestionsService } from '../services/questions.service';
import { Subscription } from 'rxjs';
import { AuthenticationService } from '../services/authentication.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.css']
templateUrl: './admin.component.html'
})
export class AdminComponent implements OnInit {
public data;
......
......@@ -4,8 +4,7 @@ import { AuthenticationService } from './services/authentication.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
templateUrl: './app.component.html'
})
export class AppComponent {
title = 'frontend';
......
......@@ -22,7 +22,7 @@ import { RemoveCategoryComponent } from './question-shit/remove-category/remove-
import { SocketIoConfig, SocketIoModule } from 'ngx-socket-io';
import { GameroomComponent } from './gameroom/gameroom.component';
const config: SocketIoConfig = { url: 'http://0.0.0.0:30992', options: { } };
const config: SocketIoConfig = { url: 'http://0.0.0.0:30992', options: { autoConnect: false } };
@NgModule({
declarations: [
......
......@@ -2,8 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core';
@Component({
selector: 'app-deletion-confirmation',
templateUrl: './deletion-confirmation.component.html',
styleUrls: ['./deletion-confirmation.component.css']
templateUrl: './deletion-confirmation.component.html'
})
export class DeletionConfirmationComponent {
......
......@@ -4,10 +4,9 @@ import { Answer } from '../Types/types';
@Component({
selector: 'app-gameroom',
templateUrl: './gameroom.component.html',
styleUrls: ['./gameroom.component.css']
templateUrl: './gameroom.component.html'
})
export class GameroomComponent implements OnInit {
export class GameroomComponent implements OnInit, OnDestroy {
playerNumber!: number;
gameStart: boolean = false;
......@@ -22,6 +21,9 @@ export class GameroomComponent implements OnInit {
private socket: SocketService) {}
ngOnInit(): void {
this.socket.connectSocket();
this.gameStart = false;
this.inRoom = false;
this.endGame = false;
......@@ -53,6 +55,10 @@ export class GameroomComponent implements OnInit {
})
}
ngOnDestroy(): void {
this.socket.disconnectSocket();
}
joinRoom(): void {
this.socket.joinRoom();
this.inRoom = true;
......
......@@ -5,8 +5,7 @@ import { AuthenticationService } from '../../services/authentication.service';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
templateUrl: './login.component.html'
})
export class LoginComponent implements OnInit {
......
......@@ -7,8 +7,7 @@ import { User } from '../../Types/types';
@Component({
selector: 'app-signup',
templateUrl: './signup.component.html',
styleUrls: ['./signup.component.css']
templateUrl: './signup.component.html'
})
export class SignupComponent {
......
......@@ -5,8 +5,7 @@ import { QuestionsService } from 'src/app/services/questions.service';
@Component({
selector: 'app-create-answer',
templateUrl: './create-answer.component.html',
styleUrls: ['./create-answer.component.css']
templateUrl: './create-answer.component.html'
})
export class CreateAnswerComponent {
createAnswer: FormGroup;
......
......@@ -5,8 +5,7 @@ import { QuestionsService } from 'src/app/services/questions.service';
@Component({
selector: 'app-create-category',
templateUrl: './create-category.component.html',
styleUrls: ['./create-category.component.css']
templateUrl: './create-category.component.html'
})
export class CreateCategoryComponent {
createCategory: FormGroup;
......
......@@ -5,8 +5,7 @@ import { QuestionsService } from 'src/app/services/questions.service';
@Component({
selector: 'app-create-question',
templateUrl: './create-question.component.html',
styleUrls: ['./create-question.component.css']
templateUrl: './create-question.component.html'
})
export class CreateQuestionComponent {
createQuestion: FormGroup;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment