-
Notifications
You must be signed in to change notification settings - Fork 232
/
index.component.ts
32 lines (28 loc) · 935 Bytes
/
index.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, OnInit } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { finalize } from 'rxjs/operators'
import { AuthService } from '../../core/authentication/auth.service';
import { TopSecretService } from '../top-secret.service';
@Component({
selector: 'top-secret-index',
templateUrl: './index.component.html',
styleUrls: ['./index.component.scss']
})
export class IndexComponent implements OnInit {
claims=null;
busy: boolean;
constructor(private authService: AuthService, private topSecretService: TopSecretService, private spinner: NgxSpinnerService) {
}
ngOnInit() {
this.busy = true;
this.spinner.show();
this.topSecretService.fetchTopSecretData(this.authService.authorizationHeaderValue)
.pipe(finalize(() => {
this.spinner.hide();
this.busy = false;
})).subscribe(
result => {
this.claims = result;
});
}
}