1 import { Component, OnInit, ViewContainerRef } from '@angular/core';
2 import { Router } from '@angular/router';
4 import { AuthService } from './core';
5 import { UserService } from './shared';
9 templateUrl: './app.component.html',
10 styleUrls: [ './app.component.scss' ]
12 export class AppComponent implements OnInit {
13 notificationOptions = {
19 showProgressBar: false,
21 preventDuplicates: false,
22 preventLastDuplicates: 'visible',
27 private router: Router,
28 private authService: AuthService,
29 private userService: UserService,
30 viewContainerRef: ViewContainerRef
34 if (this.authService.isLoggedIn()) {
35 // The service will automatically redirect to the login page if the token is not valid anymore
36 this.userService.checkTokenValidity();
41 return this.router.url.indexOf('/admin/') !== -1;