如何通过Angular CLI中的接口查询带有数组的REST API?


雨儿
2025-03-10 05:44:10 (1天前)
  1. 我正在使用Angular 7,我有一个REST API,它返回:

{ “加泰罗尼亚”: “MIN123”, “Certificaciones”:[{ “档案馆”: “KIO”, “出生日期”: “2018年12月2日”, “农布雷”:1},{ “档案馆”: “KIO” , “出生日期”: “2018年12月2日”,“…

2 条回复
  1. 0# 易米烊光 | 2019-08-31 10-32



    你的方法

    getVehiculoByID

    是一个可观察的,所以当你登录

    this.vehiculo

    它还没有解决,试着把你的

    console.log(this.vehiculo)

    在这样的任务之后:




    1. this.dataAPI.getVehiculoByID(id)
      .subscribe(vehiculo => {
      this.vehiculo = vehiculo;
      console.log(this.vehiculo);
      });

    2. </code>

登录 后才能参与评论