César Calvo
2017-03-14 f3f2452adb2723f2dde0b3429c282b835b5cdfcf
securis/src/main/webapp/src/app/app.component.ts
similarity index 83%rename from securis/src/main/webapp/src/app/app.component.tsrename to securis/src/main/webapp/src/app/home.component.ts
....@@ -1,23 +1,29 @@
11 import { Observable } from 'rxjs/Observable';
22 import { BaseRequestOptions, Http } from '@angular/http';
33 import { ToastsManager } from 'ng2-toastr/ng2-toastr';
4
-import { AfterViewInit, Component, ViewContainerRef } from '@angular/core';
4
+import { AfterViewInit, Component, ViewContainerRef, ViewChild } from '@angular/core';
55 import { DomSanitizer } from '@angular/platform-browser';
66 import { MdIconRegistry } from '@angular/material';
77 import { UserService } from './user.service';
88 import { LocalStorageService } from 'angular-2-local-storage';
99 import { TdMediaService } from '@covalent/core';
1010 import { Router } from '@angular/router';
11
+import { TdNavigationDrawerComponent } from '@covalent/core'
1112
1213 // https://github.com/Teradata/covalent-quickstart/tree/develop/src/app
1314 // https://teradata.github.io/covalent-quickstart/#/
1415
1516 @Component({
1617 selector: 'app-home',
17
- templateUrl: 'src/app/app.home.html'
18
+ templateUrl: 'src/app/home.component.html'
1819 })
19
-export class AppHomeComponent implements AfterViewInit {
20
+export class HomeComponent implements AfterViewInit {
21
+
22
+ @ViewChild('varName') child: TdNavigationDrawerComponent;
23
+
2024 securisVersion : string;
25
+ showMenu : boolean = false;
26
+
2127 constructor(private userService: UserService,
2228 toaster: ToastsManager,
2329 vRef: ViewContainerRef,
....@@ -49,9 +55,16 @@
4955 this._domSanitizer.bypassSecurityTrustResourceUrl('assets/securis_logo_black.svg'));
5056 }
5157
58
+
59
+ public clicked() {
60
+ //this.child.open();
61
+ }
62
+
5263 ngAfterViewInit(): void {
64
+ // this.showMenu = true;
5365 this.media.broadcast();
5466 this.userService.isLoggedIn().subscribe(authOk => {
67
+ //this.showMenu = authOk.valueOf();
5568 this.router.navigateByUrl(authOk ? 'packs' : 'login');
5669 },
5770 err => /* Show message */ this.router.navigateByUrl('login'));