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 {
descri:string[] = []
constructor(http:HttpClient ){
http.get<string[]>('http://localhost:8080/REST/WSATF001/entities').subscribe(descri => { console.log(descri); this.descri = descri});
}
}
aonde eu faço a chamada esta assim no html estou usando um ngfor
o serviço que eu estou tentando consumir esta assim
{"entities":[{"asset":"123451 ","type":0,"item":"0001","description":"TESTE"},{"asset":"ATIV_02 ","type":0,"item":"0001","description":"ATIVO 02"},{"asset":"ATIVO_01 ","type":0,"item":"0001","description":"ATIVO01"},{"asset":"JACA ","type":0,"item":"0001","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0002","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0003","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0004","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0005","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0006","description":"TESTE"},{"asset":"JACA ","type":0,"item":"0007","description":"TESTE"}],"hasNext":true}