You are on page 1of 1

import { Component } from '@angular/core';

import { HttpClient } from '@angular/common/http';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})

export class AppComponent {


httplabels;
httpdata;
idscala = 1;

constructor(private http: HttpClient) {}


ngOnInit() {
// lista dei clienti
this.http.get('http://localhost:3000/etichette')
.subscribe((data) => this.httplabels = data);
this.http.get('http://localhost:3000/dati?id=' + this.idscala)
.subscribe((data) => this.httpdata = data);
} // ngOnInit
// displaylabels(data) { this.httplabels = data; }
// displaydata(data) { this.httpdata = data; }
}

You might also like