1 import { Component, OnInit, ViewContainerRef } from '@angular/core';
2 import { Router } from '@angular/router';
4 import { AuthService } from './core';
5 import { VideoService } from './videos';
6 import { UserService } from './shared';
10 templateUrl: './app.component.html',
11 styleUrls: [ './app.component.scss' ]
13 export class AppComponent implements OnInit {
14 notificationOptions = {
20 showProgressBar: false,
22 preventDuplicates: false,
23 preventLastDuplicates: 'visible',
28 private router: Router,
29 private authService: AuthService,
30 private userService: UserService,
31 private videoService: VideoService,
32 viewContainerRef: ViewContainerRef
36 if (this.authService.isLoggedIn()) {
37 // The service will automatically redirect to the login page if the token is not valid anymore
38 this.userService.checkTokenValidity();
41 this.videoService.loadVideoCategories();
42 this.videoService.loadVideoLicences();
46 return this.router.url.indexOf('/admin/') !== -1;