0

我想在单个页面中显示类似的内容。复杂的是,这些数据来自 4 个不同的来源。

City One
    Property One
    Property Two
    Property Three A
    Property Three B
    Property Three C

City Two
    Property One
    Property Two
    Property Three A
    Property Three B
    Property Three C

City Three
    Property One
    Property Two
    Property Three A
    Property Three B
    Property Three C
  • City - 来自 JSON A,它返回一个包含名称和 id 的 n 个对象的简单数组。

  • 属性一来自 JSON B(使用 City.id 作为 URL 中的参数),返回一组特定于 City.id 的对象。

  • 属性二来自 JSON C(使用 City.id 作为 URL 中的参数),返回一组特定于 City.id 的对象。

  • 属性三 A/B/C 来自 JSON D(使用属性二中返回的键字段),返回一组特定于属性二中指定的特定属性键的对象。

这甚至可行吗?我知道这需要 3n+1 次半同步 JSON 调用。在这一点上,我不知道我是否应该在控制器或指令或某种疯狂的路由或什么方面寻求帮助。

我完全是 Angular 的菜鸟(我来自 ASP.NET MVC 背景),我无法绕过这个。我一直在尝试遵循 John Papa 的样式指南,因此在我的代码中的任何地方都找不到 $scope,这严重限制了我对我为解决此问题而查找的某些页面的理解。

4

0 回答 0