import { Component, OnInit } from '@angular/core'; import { ApiChatService } from '../api-chat.service'; import { HttpClient } from '@angular/common/http'; @Component({ selector: 'app-boards', templateUrl: `./boards.component.html`, styleUrls: [`./boards.component.css`] }) export class BoardsComponent implements OnInit { command: string = ""; response: any; constructor(private http: HttpClient) { console.log("Boards opened"); } listPosts() { console.log("Получаю данные..."); this.http.get('http://api.vdk2ch.ru:5000/List') .subscribe((response)=> { this.response = response; console.log(this.response); }) } ngOnInit(): void { } }