1 | import { Component, OnInit } from '@angular/core';
|
2 | import { ApiService, IAccount, IMe, IUser } from '@armor/api';
|
3 |
|
4 | @Component({
|
5 | selector: 'app-hello-armor',
|
6 | templateUrl: './hello-armor.component.html',
|
7 | styleUrls: ['./hello-armor.component.scss']
|
8 | })
|
9 | export class HelloArmorComponent implements OnInit {
|
10 | constructor(
|
11 | private apiService: ApiService
|
12 | ) { }
|
13 |
|
14 | public user: IUser;
|
15 | public accounts: IAccount[];
|
16 |
|
17 | ngOnInit() {
|
18 | this.apiService.get('me').subscribe((result: IMe) => {
|
19 | this.user = result.user;
|
20 | this.accounts = result.accounts;
|
21 | });
|
22 | }
|
23 | }
|