diff options
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 12 |
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 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { ROUTER_DIRECTIVES } from '@angular/router'; | 2 | import { Router, ROUTER_DIRECTIVES } from '@angular/router'; |
3 | 3 | ||
4 | import { MenuAdminComponent } from './admin'; | 4 | import { MenuAdminComponent } from './admin'; |
5 | import { MenuComponent } from './menu.component'; | 5 | import { MenuComponent } from './menu.component'; |
@@ -15,13 +15,9 @@ import { VideoService } from './videos'; | |||
15 | }) | 15 | }) |
16 | 16 | ||
17 | export class AppComponent { | 17 | export 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 | } |