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 | 1 | import { Observable } from 'rxjs/Observable'; |
|---|
| 2 | 2 | import { BaseRequestOptions, Http } from '@angular/http'; |
|---|
| 3 | 3 | import { ToastsManager } from 'ng2-toastr/ng2-toastr'; |
|---|
| 4 | | -import { AfterViewInit, Component, ViewContainerRef } from '@angular/core'; |
|---|
| 4 | +import { AfterViewInit, Component, ViewContainerRef, ViewChild } from '@angular/core'; |
|---|
| 5 | 5 | import { DomSanitizer } from '@angular/platform-browser'; |
|---|
| 6 | 6 | import { MdIconRegistry } from '@angular/material'; |
|---|
| 7 | 7 | import { UserService } from './user.service'; |
|---|
| 8 | 8 | import { LocalStorageService } from 'angular-2-local-storage'; |
|---|
| 9 | 9 | import { TdMediaService } from '@covalent/core'; |
|---|
| 10 | 10 | import { Router } from '@angular/router'; |
|---|
| 11 | +import { TdNavigationDrawerComponent } from '@covalent/core' |
|---|
| 11 | 12 | |
|---|
| 12 | 13 | // https://github.com/Teradata/covalent-quickstart/tree/develop/src/app |
|---|
| 13 | 14 | // https://teradata.github.io/covalent-quickstart/#/ |
|---|
| 14 | 15 | |
|---|
| 15 | 16 | @Component({ |
|---|
| 16 | 17 | selector: 'app-home', |
|---|
| 17 | | - templateUrl: 'src/app/app.home.html' |
|---|
| 18 | + templateUrl: 'src/app/home.component.html' |
|---|
| 18 | 19 | }) |
|---|
| 19 | | -export class AppHomeComponent implements AfterViewInit { |
|---|
| 20 | +export class HomeComponent implements AfterViewInit { |
|---|
| 21 | + |
|---|
| 22 | + @ViewChild('varName') child: TdNavigationDrawerComponent; |
|---|
| 23 | + |
|---|
| 20 | 24 | securisVersion : string; |
|---|
| 25 | + showMenu : boolean = false; |
|---|
| 26 | + |
|---|
| 21 | 27 | constructor(private userService: UserService, |
|---|
| 22 | 28 | toaster: ToastsManager, |
|---|
| 23 | 29 | vRef: ViewContainerRef, |
|---|
| .. | .. |
|---|
| 49 | 55 | this._domSanitizer.bypassSecurityTrustResourceUrl('assets/securis_logo_black.svg')); |
|---|
| 50 | 56 | } |
|---|
| 51 | 57 | |
|---|
| 58 | + |
|---|
| 59 | + public clicked() { |
|---|
| 60 | + //this.child.open(); |
|---|
| 61 | + } |
|---|
| 62 | + |
|---|
| 52 | 63 | ngAfterViewInit(): void { |
|---|
| 64 | + // this.showMenu = true; |
|---|
| 53 | 65 | this.media.broadcast(); |
|---|
| 54 | 66 | this.userService.isLoggedIn().subscribe(authOk => { |
|---|
| 67 | + //this.showMenu = authOk.valueOf(); |
|---|
| 55 | 68 | this.router.navigateByUrl(authOk ? 'packs' : 'login'); |
|---|
| 56 | 69 | }, |
|---|
| 57 | 70 | err => /* Show message */ this.router.navigateByUrl('login')); |
|---|