【发布时间】:2019-05-13 23:58:36
【问题描述】:
我正在使用 angular 4 和 springboot 来构建一个应用程序,但我有一个问题,我想在 html 中显示一个计数对象,但我不知道如何 这是我的仓库
@Query("select count (c) from Contact c")
int getCountOfContact();
我的服务.ts
getContactCount(){
return this.http.get("http://localhost:9090/contact/count")
.map(resp=>resp.json());
}
我的组件.ts
getCountConact(){
this.dashboardservice.getContactCount().subscribe((data)=>{
console.log(data);
},(error)=>{
console.log(error);
})
}
如何在我的 component.html 中获得结果
【问题讨论】:
标签: angular spring-boot