aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index d9549ad5b..2e0fd13f1 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,5 +1,5 @@
1import { Component } from '@angular/core'; 1import { Component } from '@angular/core';
2import { ROUTER_DIRECTIVES } from '@angular/router'; 2import { Router, ROUTER_DIRECTIVES } from '@angular/router';
3 3
4import { MenuAdminComponent } from './admin'; 4import { MenuAdminComponent } from './admin';
5import { MenuComponent } from './menu.component'; 5import { MenuComponent } from './menu.component';
@@ -15,13 +15,9 @@ import { VideoService } from './videos';
15}) 15})
16 16
17export class AppComponent { 17export class AppComponent {
18 isInAdmin = false; 18 constructor(private router: Router) {}
19 19
20 onEnteredInAdmin() { 20 isInAdmin() {
21 this.isInAdmin = true; 21 return this.router.url.indexOf('/admin/') !== -1;
22 }
23
24 onQuittedAdmin() {
25 this.isInAdmin = false;
26 } 22 }
27} 23}