Projekt

Obecné

Profil

Stáhnout (655 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 464309d9 hlavja
import {Component, OnInit} from '@angular/core';
2
import {GroupService} from '../../shared/api/endpoints/services/group.service';
3
import {tap} from 'rxjs/operators';
4
import {Group} from '../../shared/api/endpoints/models/group';
5
6
@Component({
7
  selector: 'app-index',
8
  templateUrl: './index.component.html',
9
  styleUrls: ['./index.component.scss']
10
})
11
export class IndexComponent implements OnInit {
12
13
  groups: Group[];
14
15
  constructor(
16
    private groupService: GroupService
17
  ) {
18
  }
19
20
  ngOnInit(): void {
21
  }
22
23
  getGroups() {
24
    this.groupService.getGroups({Operation: 'GetGroups'}).pipe(
25
      tap(data => this.groups = data)
26
    ).toPromise();
27
  }
28
29
}