在angular7中读取复杂的嵌套json对象数组

时间:2019-06-06 14:34:16

标签: json typescript angular7

我正在尝试读取如下所示的复杂嵌套JSON数组:

MyApp1:
  MyApp2:
      MyApp3:
         MyApp4:
            MyApp5:Array(2)
               {Tag: "UI", Technology: "Angular"}
               {Tag: "Backend", Technology: "Spring Boot"}

我正在尝试存储嵌套数组值

 {Tag: "UI", Technology: "Angular"}
 {Tag: "Backend", Technology: "Spring Boot"}

至mytechnologyArray:任意[],

这样我就可以在HTML页面中编写ngfor并显示这些值

1 个答案:

答案 0 :(得分:0)

让mytechnologyArray = myApp1.myApp2.myApp3.myApp4

html后

* ngFor =“让mytechnologyArray.myApp5的元素”,然后使用element.Tag或element.Technology检索值