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

Make translation-service available for all participant-pages/components

parent fe7d9399
No related merge requests found
......@@ -3,6 +3,8 @@ import { ContentText } from '../../../models/content-text';
import { ContentAnswerService } from '../../../services/http/content-answer.service';
import { AnswerText } from '../../../models/answer-text';
import { NotificationService } from '../../../services/util/notification.service';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../shared/LanguageService';
@Component({
selector: 'app-content-text-participant',
......@@ -16,13 +18,16 @@ export class ContentTextParticipantComponent implements OnInit {
isAnswerSent = false;
constructor(private answerService: ContentAnswerService,
private notificationService: NotificationService) {
}
private notificationService: NotificationService,
private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
this.translateService.use(sessionStorage.getItem('currentLang'));
}
// submitAnswer(answer: string) {
submitAnswer() {
if (this.textAnswer.trim().valueOf() === '') {
this.notificationService.show('No empty answer allowed.');
......
import { Component, OnInit } from '@angular/core';
import { ContentType } from '../../../models/content-type.enum';
import { AnswerOption } from '../../../models/answer-option';
import { ContentChoice } from '../../../models/content-choice';
import { ContentText } from '../../../models/content-text';
import { ContentService } from '../../../services/http/content.service';
import { ActivatedRoute } from '@angular/router';
import { Content } from '../../../models/content';
......
......@@ -3,6 +3,8 @@ import { Room } from '../../../models/room';
import { Location } from '@angular/common';
import { RoomService } from '../../../services/http/room.service';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../shared/LanguageService';
@Component({
selector: 'app-room-participant-page',
......@@ -17,13 +19,16 @@ export class RoomParticipantPageComponent implements OnInit {
constructor(private location: Location,
private roomService: RoomService,
private route: ActivatedRoute,
private router: Router) {
private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
this.route.params.subscribe(params => {
this.getRoom(params['roomId']);
});
this.translateService.use(sessionStorage.getItem('currentLang'));
}
getRoom(id: string): void {
......
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