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

Make translation-service available for all creator-pages

parent 8dbfcde5
No related merge requests found
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../shared/LanguageService';
@Component({
selector: 'app-content-create-page',
......@@ -7,8 +9,12 @@ import { Component, OnInit } from '@angular/core';
})
export class ContentCreatePageComponent implements OnInit {
constructor() { }
constructor(private translateService: TranslateService,
protected langService: LanguageService) {
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
this.translateService.use(sessionStorage.getItem('currentLang'));
}
}
......@@ -8,6 +8,8 @@ import { NotificationService } from '../../../services/util/notification.service
import { MatDialog } from '@angular/material';
import { RoomDeleteComponent } from '../_dialogs/room-delete/room-delete.component';
import { RoomEditComponent } from '../_dialogs/room-edit/room-edit.component';
import { TranslateService } from '@ngx-translate/core';
import { LanguageService } from '../../shared/LanguageService';
@Component({
selector: 'app-room-creator-page',
......@@ -22,11 +24,15 @@ export class RoomCreatorPageComponent extends RoomPageComponent implements OnIni
protected notification: NotificationService,
protected route: ActivatedRoute,
protected location: Location,
public dialog: MatDialog) {
public dialog: MatDialog,
private translateService: TranslateService,
protected langService: LanguageService) {
super(roomService, route, location);
langService.langEmitter.subscribe(lang => translateService.use(lang));
}
ngOnInit() {
this.translateService.use(sessionStorage.getItem('currentLang'));
this.route.params.subscribe(params => {
this.getRoom(params['roomId']);
});
......
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