Skip to content
Snippets Groups Projects
Commit 8e78149f authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Cleanup redundant/useless code

parent 85dbc26e
Branches
Tags
No related merge requests found
<mat-toolbar >List of Questions</mat-toolbar>
<mat-card class="outer-card">
<mat-card>
<app-comment *ngFor="let current of comments" [comment]="current"> </app-comment>
</mat-card>
mat-card {
margin-bottom: 20px;
background-color: #b2ebf2;
}
mat-card-content > :first-child {
margin-top: 20px;
border-radius: 8px;
}
mat-toolbar {
......@@ -12,11 +9,3 @@ mat-toolbar {
margin-bottom: 20px;
background-color: #bbdefb;
}
.outer-card {
border-radius: 8px;
}
.btn-right {
float: right;
}
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { Comment } from '../../../models/comment';
import { CommentService } from '../../../services/http/comment.service';
import { RoomService } from '../../../services/http/room.service';
import { NotificationService } from '../../../services/util/notification.service';
import { AuthenticationService } from '../../../services/http/authentication.service';
import { UserRole } from '../../../models/user-roles.enum';
import { User } from '../../../models/user';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../../services/util/language.service';
......@@ -17,28 +10,17 @@ import { LanguageService } from '../../../services/util/language.service';
styleUrls: ['./comment-list.component.scss']
})
export class CommentListComponent implements OnInit {
userRole: UserRole;
user: User;
comments: Comment[];
isLoading = true;
roomId: string;
roomShortId: string;
constructor(protected authenticationService: AuthenticationService,
private route: ActivatedRoute,
private roomService: RoomService,
private location: Location,
private commentService: CommentService,
private notification: NotificationService,
constructor(private commentService: CommentService,
private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
this.userRole = this.authenticationService.getRole();
this.user = this.authenticationService.getUser();
this.roomShortId = this.route.snapshot.paramMap.get('roomId');
this.roomId = localStorage.getItem(`roomId`);
this.getComments();
this.translateService.use(localStorage.getItem('currentLang'));
......
......@@ -18,10 +18,6 @@ mat-icon {
color: white;
}
.incorrect-icon {
color: white;
}
.correct-icon {
color: green;
}
......
import { Component, Input, OnInit } from '@angular/core';
import { Comment } from '../../../models/comment';
import { UserRole } from '../../../models/user-roles.enum';
import { User } from '../../../models/user';
import { AuthenticationService } from '../../../services/http/authentication.service';
import { ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
......@@ -18,7 +17,6 @@ import { LanguageService } from '../../../services/util/language.service';
export class CommentComponent implements OnInit {
@Input() comment: Comment;
userRole: UserRole;
user: User;
isLoading = true;
constructor(protected authenticationService: AuthenticationService,
......@@ -32,7 +30,6 @@ export class CommentComponent implements OnInit {
ngOnInit() {
this.userRole = this.authenticationService.getRole();
this.user = this.authenticationService.getUser();
this.translateService.use(localStorage.getItem('currentLang'));
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment