mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-04-19 12:48:36 +00:00
27 lines
844 B
TypeScript
27 lines
844 B
TypeScript
// Copyright (C) 2018 Avatao.com Innovative Learning Kft.
|
|
// All Rights Reserved. See LICENSE file for details.
|
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
import { Title } from '@angular/platform-browser';
|
|
import { config } from './config';
|
|
|
|
@Component({
|
|
selector: 'app-root',
|
|
templateUrl: './app.component.html',
|
|
styleUrls: ['./app.component.scss']
|
|
})
|
|
export class AppComponent implements OnInit {
|
|
documentTitle: string = config.documentTitle;
|
|
|
|
constructor(private titleService: Title) {}
|
|
|
|
ngOnInit() {
|
|
this.titleService.setTitle(this.documentTitle);
|
|
window.addEventListener('beforeunload', (event) => {
|
|
const confirmationMessage = 'Refreshing this page may mess up your challenge/tutorial state. Are you sure?';
|
|
event.returnValue = confirmationMessage;
|
|
return confirmationMessage;
|
|
});
|
|
}
|
|
}
|