app.component.ts 908 Bytes
Newer Older
1
import { Component } from '@angular/core';
Chris Hines's avatar
Chris Hines committed
2
import { TesService } from './tes.service';
3
4
5
6
7
8
9

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
Chris Hines's avatar
Chris Hines committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  title = 'Strudelv2';
  private loggedin: Boolean = false;
  private errmsg: string='';
  private authorised: boolean;
  // private testingAuth: boolean;

  constructor(private tesService: TesService,) {
   };

  ngOnInit() {
    setTimeout(() =>  { this.tesService.authorised.subscribe(authorised => { this.authorised = authorised }); });
    // this.tesService.testingAuth.subscribe(testingAuth => { this.testingAuth = testingAuth; console.log('testingAuth updated'+this.testingAuth) });
    // this.testingAuth = false;
  }

  login() {
    console.log("login");
    this.tesService.login()
  }

  logout() {
    console.log("logout");
    this.tesService.logout();
  }
34
}