Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 06b9ca68

Přidáno uživatelem Václav Jirák před téměř 6 roky(ů)

Re #7263 Static view for employer initialized

Zobrazit rozdíly:

frontend/src/app/app.component.ts
1 1
import { Component, OnInit } from '@angular/core';
2
import { HttpClient } from '@angular/common/http';
3
import { environment } from '../environments/environment';
4 2

  
5 3
@Component({
6 4
  selector: 'app-root',
......
8 6
  styleUrls: ['./app.component.sass']
9 7
})
10 8
export class AppComponent implements OnInit {
11
  getTestResponse;
12
  postTestResponse;
13
  enHelloWorldResponse;
14
  czHelloWorldResponse;
15
  databaseResponse;
16
  constructor(private httpClient: HttpClient) {}
17 9

  
18
  ngOnInit() {
19
    this.httpClient.get(environment.apiUrl + 'test', { responseType: 'text' })
20
      .subscribe(data => this.getTestResponse = data);
21

  
22
    this.httpClient.post(environment.apiUrl + 'test', {}, { responseType: 'text' })
23
      .subscribe(data => this.postTestResponse = data);
24

  
25
    this.httpClient.get(environment.apiUrl + 'hello', { responseType: 'text' })
26
      .subscribe(data => this.enHelloWorldResponse = data);
10
  menuItems = ['DASHBOARD', 'ZAMESTNANCI'];
11
  constructor() {}
27 12

  
28
    this.httpClient.get(environment.apiUrl + 'hello?lang=cz', { responseType: 'text' })
29
      .subscribe(data => this.czHelloWorldResponse = data);
30

  
31
    this.httpClient.get(environment.apiUrl + 'database', { responseType: 'text' })
32
      .subscribe(data => this.databaseResponse = data);
13
  ngOnInit() {
33 14
  }
34 15
}

Také k dispozici: Unified diff